I migrated my existing entity listeners to the newer style as found in the documentation.
However,
I have one entylistener on an abstract class. the newer style does not work on superclasses. Could this be added?
I migrated my existing entity listeners to the newer style as found in the documentation.
However,
I have one entylistener on an abstract class. the newer style does not work on superclasses. Could this be added?
Use wildcard type parameters. For example, if Foo
is a superclass, the following listener should work for all entities inherited from it:
@Component("app_FooChangedListener")
public class FooChangedListener {
@TransactionalEventListener(phase = TransactionPhase.BEFORE_COMMIT)
public void beforeCommit(EntityChangedEvent<? extends Foo, UUID> event) {
}
}
Regards,
Konstantin
perfect thx, and an elegant solution .