]
Cheng Fang reassigned WFLY-13186:
---------------------------------
Assignee: Scott Marlow (was: Cheng Fang)
Multiple @PostLoad in @MappedSuperclass
---------------------------------------
Key: WFLY-13186
URL:
https://issues.redhat.com/browse/WFLY-13186
Project: WildFly
Issue Type: Bug
Components: JPA / Hibernate
Affects Versions: 18.0.1.Final
Reporter: Stefan Lindner
Assignee: Scott Marlow
Priority: Major
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?
h3. This does not work
{code:title=SuperClass.java|borderStyle=solid}
@MappedSuperclass
public abstract Superclass {
@PostLoad
public void postLoad() {
System.out.println("Superclass.postLoad");
}
}
{code}
{code:title=EntityClass.java|borderStyle=solid}
@Entity
public class EntityClass extends SuperClass {
@PostLoad
public void postLoad() {
System.out.println("Superclass.postLoad");
}
}
{code}
h3. This works
{code:title=SuperClass.java|borderStyle=solid}
@MappedSuperclass
public abstract Superclass {
@PostLoad
public void otherPostLoad() {
System.out.println("Superclass.postLoad");
}
}
{code}
{code:title=EntityClass.java|borderStyle=solid}
@Entity
public class EntityClass extends SuperClass {
@PostLoad
public void postLoad() {
System.out.println("Superclass.postLoad");
}
}
{code}