Listener for lazy-loading fields in JPA entity

Viewed 25

Is it possible to add a custom listener/hook which would be triggered after loading a lazy field of an entity (e.g. @OneToMany collection) where you can put your custom code?

I can imagine something similar to @PostLoad annotation but which would be triggered later, at the 1st access to the lazy field.

No biggie if it's possible but without reference to the concrete field.

1 Answers
Related