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

Using Immutables with AWS DynamoDBMapper #770

Open
velpratheesh opened this issue May 11, 2018 · 1 comment
Open

Using Immutables with AWS DynamoDBMapper #770

velpratheesh opened this issue May 11, 2018 · 1 comment
Labels

Comments

@velpratheesh
Copy link

velpratheesh commented May 11, 2018

I stumbled across Immutables library and found it to be really good. I am trying to use it with DynamoDBMapper to read/write from Dynamo DB.

DynamoDBMapper only allows mutable objects to be serialized/deserialized. I am running into a issue where DynamoDBMapper writes the value of isInitialized method since it is public. Also throws an exception while reading it since there is no corresponding setter.

Is there a way to generate modifiable classes without isInitialized functionality (or make it private or add DynamoDBIgnore annotation to it)?

@elucash
Copy link
Member

elucash commented May 17, 2018

Hi @velpratheesh thank you for asking this, sorry for delayed response. I've tried to find a suitable workaround for this and think you can try to rename "isInitialized" method using style annotation, cannot be 100% sure it will work, but here's the example

@Value.Style(
   isInitialized="wasInitialized",  // <-- so it will not recognized as getter by "is*" prefix
   beanFriendlyModifiables=true)   // <-- can improve compatibility with some tools
                                  //making modifiable more like bean (setters return void... etc)

Please, see the introduction to styles: http://immutables.github.io/style.html

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

No branches or pull requests

2 participants