Marko Bekhta (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNTE1ZTQwNTlj...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-17019?atlOrigin=eyJpIjoiNTE1ZT...
) HHH-17019 (
https://hibernate.atlassian.net/browse/HHH-17019?atlOrigin=eyJpIjoiNTE1ZT...
) EntityListener is not triggered for a LAZY loaded association (
https://hibernate.atlassian.net/browse/HHH-17019?atlOrigin=eyJpIjoiNTE1ZT...
)
Issue Type: Bug Affects Versions: 6.3.0.CR1, 6.2.7 Assignee: Unassigned Created:
01/Aug/2023 06:36 AM Priority: Major Reporter: Marko Bekhta (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Assume having a model like:
@Entity(name = "Person" )
@EntityListeners(PersonListener.class)
public static class Person {
@Id
private int id;
@OneToMany(mappedBy = "person" )
private Collection<Tag> tags = new ArrayList<>();
}
@Entity(name = "Tag" )
public static class Tag {
@Id
private int id;
@ManyToOne(fetch = FetchType.LAZY)
private Person person;
}
public static class PersonListener {
@PostLoad
void onPreUpdate( Object o) {
// do something important :)
}
}
Then when the tag is loaded and a person is accessed through it – the listener is not
triggered.
Will link a reproducer
(
https://hibernate.atlassian.net/browse/HHH-17019#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-17019#add-comment?atlOrigin=ey...
)
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....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100233- sha1:b4f309b )