tropikalista tropikalista - 1 year ago 143
Java Question

Hibernate @PostLoad never gets invoked

Looked at many forums but haven't found answer...Simple stuff, method annotated with @PostLoad never gets invoked...added listener via @EntityListeners but problem remains. I'm using SessionFactory based configuration.

Answer Source

The EJB3 @PostLoad annotation doesn’t work when using a SessionFactory based configuration, the post-load method will never get called.

Either use Hibernate's Interceptors or events or an EntityManager based configuration.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download