• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Default values for Hibernate POJO fields using annotations?

 
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic