[hibernate-issues] [JIRA] (HHH-13887) Multiple @PostLoad (in @Entity and @MappedSuperclass)
Stefan Lindner (JIRA)
jira at hibernate.atlassian.net
Tue Mar 3 17:31:07 EST 2020
Stefan Lindner ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A25d0eef4-5c83-4cc8-a430-09047271e2ad ) *created* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMDJiMDNiOTZiYTI4NDgwYzg4NGI4MWI2MzA5MGUwZDIiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-13887?atlOrigin=eyJpIjoiMDJiMDNiOTZiYTI4NDgwYzg4NGI4MWI2MzA5MGUwZDIiLCJwIjoiaiJ9 ) HHH-13887 ( https://hibernate.atlassian.net/browse/HHH-13887?atlOrigin=eyJpIjoiMDJiMDNiOTZiYTI4NDgwYzg4NGI4MWI2MzA5MGUwZDIiLCJwIjoiaiJ9 ) Multiple @PostLoad (in @Entity and @MappedSuperclass) ( https://hibernate.atlassian.net/browse/HHH-13887?atlOrigin=eyJpIjoiMDJiMDNiOTZiYTI4NDgwYzg4NGI4MWI2MzA5MGUwZDIiLCJwIjoiaiJ9 )
Issue Type: Bug Affects Versions: 5.3.11 Assignee: Unassigned Components: hibernate-entitymanager Created: 03/Mar/2020 14:31 PM Environment: Adopt OPENJDK11/OpenJ9
Wildfly 18.0.1
Win 10/64bit
PÜostgreSQL 12 Priority: Major Reporter: Stefan Lindner ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A25d0eef4-5c83-4cc8-a430-09047271e2ad )
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.
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( "EntityClass .postLoad" );
}
}
*EntityClass.java*
@Entity
public class EntityClass extends SuperClass {
@PostLoad
public void postLoad() {
System.out.println( "EntityClass .postLoad" );
}
}
( https://hibernate.atlassian.net/browse/HHH-13887#add-comment?atlOrigin=eyJpIjoiMDJiMDNiOTZiYTI4NDgwYzg4NGI4MWI2MzA5MGUwZDIiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-13887#add-comment?atlOrigin=eyJpIjoiMDJiMDNiOTZiYTI4NDgwYzg4NGI4MWI2MzA5MGUwZDIiLCJwIjoiaiJ9 )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100121- sha1:a532aba )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200303/4fab20ac/attachment.html
More information about the hibernate-issues
mailing list