Is there a difference in declaring the enabled variable as Boolean or boolean? Which is preferable from a memory footprint perspective.
@Entity
class User {
Kaleb's right - if any queries return a null value for "enabled" (in this case) then you have to use the object rather than the primitive.
This is from the Hibernate FAQ:
A PropertyAccessException often occurs when the object being passed to the setter method is of the wrong type. Check your type mappings for the offending property. (To see exactly which property was the problem, you might need to disable the CGLIB reflection optimizer.) However, the most common cause of this problem is that Hibernate attempted to assign null to a property of primitive type.
If your object has a primitive-type property mapped to a nullable database column then you will need to use a Hibernate custom type to assign a sensible default (primitive) value for the case of a null column value. A better solution is usually to use a wrapper type for the Java property.
https://www.hibernate.org/116.html