This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
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 OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate annotation: exclude a field
 
It's not a secret anymore!