spring-framework / org.springframework.orm.hibernate5 / HibernateTransactionManager / setEntityInterceptor

setEntityInterceptor

open fun setEntityInterceptor(@Nullable entityInterceptor: Interceptor): Unit

Set a Hibernate entity interceptor that allows to inspect and change property values before writing to and reading from the database. Will get applied to any new Session created by this transaction manager.

Such an interceptor can either be set at the SessionFactory level, i.e. on LocalSessionFactoryBean, or at the Session level, i.e. on HibernateTransactionManager.

See Also
LocalSessionFactoryBean#setEntityInterceptor