Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate - How to disable mapping for a column

When tagged as @Entity, each attribute of a class is mapped to one database column. I have some classes where I want to add some fields for internal usage, but I don't want them to be mapped by hibernate to a database column. Is there a way to do so?

Thanks

like image 694
Ticker23 Avatar asked Jun 09 '11 15:06

Ticker23


1 Answers

Its either you mark the variables with @javax.persistence.Transient or declare it as transient.

@javax.persistence.Transient
String myTransietnColumn;



transient String myAnotherTransientColumn;
like image 107
gouki Avatar answered Oct 22 '22 03:10

gouki