Hi
My persisted entity has a primitive "selected" boolean field that
does not require persistence. When the entity is loaded, however, the PropertyAccessException is thrown, as the setter for selected requires a non-null, non-primitive value. Without declaring the field as a column, I cannot tell hibernate to set the field to not-nullable.
Quote:
org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of com.geca.domain.ContactPerson.selected
...
Caused by: java.lang.IllegalArgumentException: Can not set boolean field com.geca.domain.ContactPerson.selected to null value
All answers on the web tell me to change the primitive to it's wrapper type, but I'd like to avoid this as it forces me to put in unnessecarry null-checks in controller logic.
Is there a way I can retain the primitive type on this entity?
Thanks in advance!