2

I have an entity in JPA. I recently added a field to my entity. I do not want this field to be persisted. However, Eclipselink is complaining about it not being in the table (which it obviously isnt).

How can I exclude this class from be looked at by JPA. Please note that this field cannot be transient.

user489041
  • 27,916
  • 55
  • 135
  • 204

2 Answers2

3

You can add JPA's @Transient. Field annotated with Transient will not be persisted.

Semyon Danilov
  • 1,753
  • 1
  • 17
  • 37
0

One option is adding @Transient annotation if on the other hand you use transient keyword that means the field won't be serialized. More on Why does JPA have a @Transient annotation?

Community
  • 1
  • 1
Mite Mitreski
  • 3,596
  • 3
  • 29
  • 39