This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes [Hibernate] Default value for not-null column does not seem to work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "[Hibernate] Default value for not-null column does not seem to work" Watch "[Hibernate] Default value for not-null column does not seem to work" New topic
Author

[Hibernate] Default value for not-null column does not seem to work

Saurabh Pillai
Ranch Hand

Joined: Sep 12, 2008
Posts: 506


My interpretation of "default" is, When I need to save an object of this class, if I do not set the value of column "isActive" (using setter method), hibernate will "intelligently" pick the default value while preparing the insert query. but it does not seem to happen. Instead I get following exception,



Any idea?
 
wood burning stoves
 
subject: [Hibernate] Default value for not-null column does not seem to work
 
Similar Threads
During delete org.springframework.dao.InvalidDataAccessApiUsageException: object references
Exception setting property value with CGLIB
Problem in matching property type
Hibernate mapping and versioning issues
DATABASE ERROR: java.sql.SQLException: Invalid argument(s) in call