Off the cuff suggestion (not tested).
What if you defined an AbstractBaseClass in which you put all your properties, accessors and methods, and you annotate all of these as you normally would. Also annotate this abstract class with the annotation:
@MappedSuperclass
(Do not use @Entity, here!)
Then, use that AbstractBaseClass as the mother of your other two classes. Those two classes will be empty (unless you wish to add some proprietary stuff in either), and annotate each with the usual:
@Entity etc.
In that setup, you can annotate each real class with its own
@Cache
annotation.
How does that sound?
|