This is a request to support looking for callbacks on the superclasses of an applied entity-listener. E.g.:
{code} class MyListenerBase { @PrePersist public void prePersistCallback(Object theEntity) { ... } }
class MyListenerSub extends MyListenerBase { @PreRemove public void preRemoveCallback(Object theEntity) { ... } }
@Entity @EntityListeners(MyListenerSub.class) class MyEntity { ... } {code}
We need to be careful in dealing with overrides though. E.g.:
{code} class MyListenerBase { @PrePersist public void prePersistCallback(Object theEntity) { ... } }
class MyListenerSub extends MyListenerBase { @Override @PrePersist public void prePersistCallback(Object theEntity) { ... } }
@Entity @EntityListeners(MyListenerSub.class) class MyEntity { ... } {code}
Or even:
{code} class MyListenerBase { @PrePersist public void prePersistCallback(Object theEntity) { ... } }
class MyListenerSub extends MyListenerBase { @Override public void prePersistCallback(Object theEntity) { ... } }
@Entity @EntityListeners(MyListenerSub.class) class MyEntity { ... } {code}
---- h2. Original description
*Overview*
I have an abstract class that declares a listener method with @PostPersist (among others). I have a subclass that extends the abstract class.
The subclass is registered by either an annotated entity or as the default listener class.
*Issue*
The annotated method is never called because it seems CallbackBuilderLegacyImpl only looks for annotated methods in the subclass. |
|