Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate annotation: exclude a field  RSS feed

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In hibernate annotation, a class is declared as org.hibernate.annotations.Entity, how can I exclude a field so that it will NOT be mapped in database ? In traditional way, that is easy, we don't need write that field in hbm xml file.

Thanks.
 
Kuladip Yadav
Ranch Hand
Posts: 162
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use @Transient for that field, So it will not persist in to database.

Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!