[jboss-jira] [JBoss JIRA] (WFLY-13186) Multiple @PostLoad in @MappedSuperclass
Cheng Fang (Jira)
issues at jboss.org
Tue Mar 3 15:56:00 EST 2020
[ https://issues.redhat.com/browse/WFLY-13186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
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}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list