O'Reilly logo

Spring Persistence with Hibernate by Ahmad Seddighi

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Interceptor

Hibernate provides full control of an object's states in its life cycle, allowing you to define custom behaviors when the object's state changes. Hibernate can do this thanks to interceptors and listeners. An interceptor is an old mechanism used by Hibernate 2.x. Hibernate 3 introduced the event/listener model instead, but has not removed support for interceptors. Although any interceptor lets you define custom behaviors for all object states, listeners are used at a particular state of an object. To define an interceptor, first implement the Interceptor interface and override the appropriate methods, and then apply it to the Configuration or Session object. Notice that the implemented interceptor cannot be declared declaratively through ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required