aspose file tools*
The moose likes Object Relational Mapping and the fly likes Hibernate annotation: exclude a field Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate annotation: exclude a field" Watch "Hibernate annotation: exclude a field" New topic
Author

Hibernate annotation: exclude a field

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
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

Joined: Jul 30, 2008
Posts: 162

You can use @Transient for that field, So it will not persist in to database.

Thanks
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Hibernate annotation: exclude a field