I have multiple classes annotated with @Entity
. Half of the classes have these 3 additional fields in them: specialFieldA
, specialFieldB
, and specialFieldC
; the other half do not.
Is there a JPA way to ensure that future classes have these 3 fields in them? I.e. if a teammate wants to make another class with specialFieldA
, specialFieldB
, and specialFieldC
in them, is there a way to enforce having these 3 fields?
I thought of using an interface, but it didn't seem like the right strategy since you can only define methods.
I can't use an abstract class because these classes already extend a parent class.