Using {{ @PostLoad }} in a {{ @MappedSuperclass }} does not work it the annotated method has the same name as in {{ @Entity }} class. I did not find any hints in the specs about the behavior in this case. Is it allowed? The SuperClass ist part of another module than EntityClass.
h3. This does not work *SuperClass.java*
{code: title=SuperClass. java |borderStyle=solid } @MappedSuperclass public abstract Superclass {
@PostLoad public void postLoad() { System.out.println("Superclass.postLoad"); } } {code}
*EntityClass.java*
{code: title=EntityClass. java |borderStyle=solid } @Entity public class EntityClass extends SuperClass { @PostLoad public void postLoad() { System.out.println(" Superclass EntityClass .postLoad"); } } {code}
h3. This works *SuperClass.java*
{code: title=SuperClass. java |borderStyle=solid } @MappedSuperclass public abstract Superclass {
@PostLoad // ||||||||||||| // VVVVVVVVVVVVV public void otherPostLoad() { System.out.println(" EntityClass Superclass .postLoad"); } } {code}
*EntityClass.java*
{code: title=EntityClass. java |borderStyle=solid } @Entity public class EntityClass extends SuperClass { @PostLoad public void postLoad() { System.out.println("EntityClass .postLoad"); } } {code} |
|