setEntityInterceptor(Interceptor entityInterceptor)
Set a Hibernate entity interceptor that allows to inspect and change
property values before writing to and reading from the database.

void

setEntityInterceptorBeanName(String entityInterceptorBeanName)
Set the bean name of a Hibernate entity interceptor that allows to inspect
and change property values before writing to and reading from the database.

void

setFilterName(String filter)
Set the name of a Hibernate filter to be activated for all
Sessions that this accessor works with.

void

setFilterNames(String[] filterNames)
Set one or more names of Hibernate filters to be activated for all
Sessions that this accessor works with.

void

setFlushMode(int flushMode)
Set the flush behavior to one of the constants in this class.

void

setFlushModeName(String constantName)
Set the flush behavior by the name of the respective constant
in this class, e.g.

FLUSH_AUTO

public static final int FLUSH_AUTO

Automatic flushing is the default mode for a Hibernate Session.
A session will get flushed on transaction commit, and on certain find
operations that might involve already modified instances, but not
after each unit of work like with eager flushing.

In case of an existing Session, FLUSH_AUTO will participate in the
existing flush mode, not modifying it for the current operation.
This in particular means that this setting will not modify an existing
flush mode NEVER, in contrast to FLUSH_EAGER.

FLUSH_EAGER

public static final int FLUSH_EAGER

Eager flushing leads to immediate synchronization with the database,
even if in a transaction. This causes inconsistencies to show up and throw
a respective exception immediately, and JDBC access code that participates
in the same transaction will see the changes as the database is already
aware of them then. But the drawbacks are:

additional communication roundtrips with the database, instead of a
single batch at transaction commit;

the fact that an actual database rollback is needed if the Hibernate
transaction rolls back (due to already submitted SQL statements).

In case of an existing Session, FLUSH_EAGER will turn the flush mode
to AUTO for the scope of the current operation and issue a flush at the
end, resetting the previous flush mode afterwards.

FLUSH_COMMIT

Flushing at commit only is intended for units of work where no
intermediate flushing is desired, not even for find operations
that might involve already modified instances.

In case of an existing Session, FLUSH_COMMIT will turn the flush mode
to COMMIT for the scope of the current operation, resetting the previous
flush mode afterwards. The only exception is an existing flush mode
NEVER, which will not be modified through this setting.

setEntityInterceptorBeanName

Set the bean name of 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.

Requires the bean factory to be known, to be able to resolve the bean
name to an interceptor instance on session creation. Typically used for
prototype interceptors, i.e. a new interceptor instance per session.

Can also be used for shared interceptor instances, but it is recommended
to set the interceptor reference directly in such a scenario.

Parameters:

entityInterceptorBeanName - the name of the entity interceptor in
the bean factory

setEntityInterceptor

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 object.

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

getFlushMode

setFilterName

Set the name of a Hibernate filter to be activated for all
Sessions that this accessor works with.

This filter will be enabled at the beginning of each operation
and correspondingly disabled at the end of the operation.
This will work for newly opened Sessions as well as for existing
Sessions (for example, within a transaction).

setFilterNames

Set one or more names of Hibernate filters to be activated for all
Sessions that this accessor works with.

Each of those filters will be enabled at the beginning of each
operation and correspondingly disabled at the end of the operation.
This will work for newly opened Sessions as well as for existing
Sessions (for example, within a transaction).