Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis repositories deserialize Map<Integer, Integer> to strings [DATAREDIS-768] #1347

Closed
spring-projects-issues opened this issue Feb 1, 2018 · 0 comments

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Feb 1, 2018

Mark Paluch opened DATAREDIS-768 and commented

RedisHash("rating")
public class Rating implements Serializable {

	private static final long serialVersionUID = -172746605175988617L;
	
	@Id
	private Long presentationId;
	private Map<Integer, Integer> distribution = new HashMap<Integer, Integer>();
	private Double averageScore;
	private Integer ratingsCount;
	private Integer ratingsTotal;

....getters/setters omitted

}

When I get it out of Redis, all my Keys are suddenly of type String:

2018-02-01 11:02:17.902 DEBUG 29102 --- [nio-8091-exec-4] c.l.c.scorecard.rating.RatingService     : Retrieved 1 from Redis: 
2018-02-01 11:02:17.902 DEBUG 29102 --- [nio-8091-exec-4] c.l.c.scorecard.rating.RatingService     : ---------------------------------------------
2018-02-01 11:02:17.903 DEBUG 29102 --- [nio-8091-exec-4] c.l.c.scorecard.rating.RatingService     : Rating {presentationId=1, averageScore=2.0, Distribution=[(Score: 3 Count: 0) , (Score: 2 Count: 1) , (Score: 5 Count: 0) , (Score: 1 Count: 0) , (Score: 4 Count: 0) ] }
2018-02-01 11:02:17.903 DEBUG 29102 --- [nio-8091-exec-4] c.l.c.scorecard.rating.RatingService     : Types of the distribution keys coming from Redis:
2018-02-01 11:02:17.903 DEBUG 29102 --- [nio-8091-exec-4] c.l.c.scorecard.rating.RatingService     : java.lang.String

Referenced from: pull request #312

Backported to: 2.0.4 (Kay SR4), 1.8.11 (Ingalls SR11)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants