Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

HibernateTemplate.EntityInterceptor Property

Gets or sets the entity interceptor that allows to inspect and change property values before writing to and reading from the database.

[Visual Basic]
Public Overrides Property EntityInterceptor() As IInterceptor
   Public Get
   End Get
   Public Set
   End Set
End Property
public override IInterceptor EntityInterceptor { public get; public set; }

Property Value

The interceptor.


Will get applied to any new ISession created by this object.

Such an interceptor can either be set at the ISessionFactory level, i.e. on LocalSessionFactoryObject, or at the ISession level, i.e. on HibernateTemplate, HibernateInterceptor, and HibernateTransactionManager. It's preferable to set it on LocalSessionFactoryObject or HibernateTransactionManager to avoid repeated configuration and guarantee consistent behavior in transactions.


Exception Type Condition
InvalidOperationException If object factory is not set and need to retrieve entity interceptor by name.

See Also

HibernateTemplate Class | Spring.Data.NHibernate Namespace