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

Problems adding a Boolean to an existing class #16

Closed
joergrech opened this issue Sep 7, 2012 · 3 comments
Closed

Problems adding a Boolean to an existing class #16

joergrech opened this issue Sep 7, 2012 · 3 comments

Comments

@joergrech
Copy link

Hi,
when I add a Boolean to an existing domain class (that is already used and has instances in Redis) I get the following exception:

Cannot convert value of type [null] to required type [boolean] for property 'isValid':
PropertyEditor [org.springframework.beans.propertyeditors.CustomBooleanEditor]
returned inappropriate value of type [null]

I tried to add the constraint nullable:true to the boolean (isValid nullable: true) and tried to use a default value (boolean isValid = false) but that did not help.

Am I doing something wrong or has redis/jedis a problem using nullable booleans or converting missing fields from the redis DB into a null boolean?

@tednaleid
Copy link
Contributor

@joergrech it sounds like you're using the grails redis-gorm plugin, which provides domain class integration with redis. This plugin is the vanilla redis plugin that just gives you a connection pool to redis with some helper methods.

I'm closing this issue, but please let me know if I'm misunderstanding your question.

@burtbeckwith
Copy link
Contributor

Make the type Boolean, not boolean, since boolean cannot be null, only true or false

@joergrech
Copy link
Author

@tednaleid Yes, I was using the redis-gorm plugin. Sorry for the inconvenience.
@burtbeckwith Aha sounds right I will test it on Monday - thanks for the tip.

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

No branches or pull requests

3 participants