aspose file tools*
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
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: 509


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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Hibernate] Default value for not-null column does not seem to work