5

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

Ticker23
  • 172
  • 4
  • 19

1 Answers1

13

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

@javax.persistence.Transient
String myTransietnColumn;



transient String myAnotherTransientColumn;
gouki
  • 4,382
  • 3
  • 20
  • 20