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,066
  • 55
  • 130
  • 201

2 Answers2

3

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

Semyon Danilov
  • 1,723
  • 1
  • 16
  • 35
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,528
  • 3
  • 26
  • 38