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

Custom type of Set and Map serialization #436

Closed
wants to merge 9 commits into from
Closed

Custom type of Set and Map serialization #436

wants to merge 9 commits into from

Conversation

yyc1217
Copy link

@yyc1217 yyc1217 commented Nov 30, 2013

For custom type of Set and Map serialization.

Set:

@Column
@Serializer(FooSerializer.class)
private Set<Foo> fooSet;

SetColumnMapper gets FooSerializer from @Serializer.
If there is no explicit @Serializer, then it will inferred from Foo, which is the first generic type.

Map:

@Column
@Serializer(FooSerializer.class)
private Map<String, Foo> fooMap;

MapColumnMapper gets FooSerializer from @Serializer only for value part, not for key.
If there is no explicit @Serializer, then it will inferred from 'Foo', which is the second generic type. It's not support custom type key for now.

@yyc1217
Copy link
Author

yyc1217 commented Nov 30, 2013

I was wondering some annotations like

@Serializer(mapKey=KeySerializer.class, mapValue=ValueSerializer.class) 
@MapSerializer(key=KeySerializer.class, value=ValueSerialier.class) 

to specify serializer for Map type.

Furthermore, for Set type?

@SetSerializer(ValueSerializer.class)

@yyc1217 yyc1217 closed this Feb 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant