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
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
 
Similar Threads
how to exclude a class member from hibernate mapping?
Query fields for Annotations
I am getting null value for particular column, while loading the object.
how to use hibernate annotations with abstract methods
Persistence Unit: Unable to build EntityManagerFactory