Assume having a model like:
{code:java}@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 :) } }{code}
Then when the tag is loaded and a person is accessed through it – the listener is not triggered.
Will link a A reproducer ([https://github.com/hibernate/hibernate-orm/pull/7105|https://github.com/hibernate/hibernate-orm/pull/7105|smart-link] ) |
|