Details
-
Task
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0
-
None
Description
We need an ability to define a callback method in a common superclass of some entities and register it just once:
LifecycleEventCallbackMap prePersist = ...
prePersist.addListener(MySuper.class, "prePersist");
Then individual entities may choose to override this method if they want to customize the behavior of callback. Or they may implicitly rely on the superclass. JPA supports that as "listeners on mapped superclass". Cayenne doesn't have a formal notion of a mapped superclass (abstract entity would be the closest), and we can simply support it on any superclass that is registered explicitly.
(also note that JPA supports "excludes superclass" flag ... not sure if it is applicable here, as the registration is explicit.
Attachments
Issue Links
- is related to
-
CAY-660 JPA-like callbacks support in the main Cayenne stack
- Closed