Why is there no @PreLoad entity listener?

here are the JPA2 entity listener annotations:

@PrePersist
@PreRemove
@PostPersist
@PostRemove
@PreUpdate
@PostUpdate
@PostLoad

However, there is no @PreLoad annotation? How can it be?

+4
source share
1 answer

I would apply the same knowledge as with JSF - what is the difference between @PostConstruct and direct method call from the constructor? . @PostLoadexecuted after the constructor and has all the dependent dependencies JPA, and the object of this class is actually @Entity, not a simple object Java. Thus, a nonexistent one @PreLoadwill actually be a constructor, but is @Entitynot @Entityyet before @PostLoad.

+2
source

Source: https://habr.com/ru/post/1546968/


All Articles