Details
-
Bug
-
Resolution: Not a Bug
-
Major
-
None
-
18.0.1.Final
-
None
Description
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?
This does not work
SuperClass.java
@MappedSuperclass public abstract Superclass { @PostLoad public void postLoad() { System.out.println("Superclass.postLoad"); } }
EntityClass.java
@Entity public class EntityClass extends SuperClass { @PostLoad public void postLoad() { System.out.println("Superclass.postLoad"); } }
This works
SuperClass.java
@MappedSuperclass public abstract Superclass { @PostLoad public void otherPostLoad() { System.out.println("Superclass.postLoad"); } }
EntityClass.java
@Entity public class EntityClass extends SuperClass { @PostLoad public void postLoad() { System.out.println("Superclass.postLoad"); } }