• Post Reply Bookmark Topic Watch Topic
  • New Topic

Default values for Hibernate POJO fields using annotations?  RSS feed

 
James Adams
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Hibernate POJO which contains a boolean field, and if the object doesn't already exist (i.e. when a new one is created) then I want the boolean field value to default to false. How can I accomplish this using annotations?

I currently map this field like so:


Thanks in advance for any suggestions.

--James
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!