[jboss-jira] [JBoss JIRA] (WFLY-13186) Multiple @PostLoad in @MappedSuperclass
Scott Marlow (Jira)
issues at jboss.org
Tue Mar 3 16:34:00 EST 2020
[ https://issues.redhat.com/browse/WFLY-13186?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13988170#comment-13988170 ]
Scott Marlow commented on WFLY-13186:
-------------------------------------
Hibernate ORM bugs can be created via the [ Hibernate issue tracker|https://hibernate.atlassian.net/browse/HHH].
I don't recall there being a JPA specification reason why your test case would fail.
> 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