类 AbstractDelegatingSessionBuilder<T extends SessionBuilder>
- java.lang.Object
-
- org.hibernate.engine.spi.AbstractDelegatingSessionBuilder<T>
-
- 所有已实现的接口:
SessionBuilder<T>
public abstract class AbstractDelegatingSessionBuilder<T extends SessionBuilder> extends Object implements SessionBuilder<T>
Base class forSessionBuilderimplementations that wish to implement only parts of that contract themselves while forwarding other method invocations to a delegate instance.- 作者:
- Gunnar Morling, Guillaume Smet
-
-
构造器概要
构造器 构造器 说明 AbstractDelegatingSessionBuilder(SessionBuilder delegate)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 TautoClear(boolean autoClear)Should the session be automatically cleared on a failed transaction?TautoClose(boolean autoClose)Should the session be automatically closed after transaction completion?TautoJoinTransactions(boolean autoJoinTransactions)Should the session built automatically join in any ongoing JTA transactions.TclearEventListeners()Remove all listeners intended for the built Session currently held here, including any auto-apply ones; in other words, start with a clean slate.Tconnection(Connection connection)Adds a specific connection to the session options.TconnectionHandlingMode(PhysicalConnectionHandlingMode mode)Signifies that the connection release mode from the original session should be used to create the new session.TconnectionReleaseMode(ConnectionReleaseMode connectionReleaseMode)Use a specific connection release mode for these session options.protected SessionBuilderdelegate()TeventListeners(SessionEventListener... listeners)Apply one or more SessionEventListener instances to the listeners for the Session to be built.TflushBeforeCompletion(boolean flushBeforeCompletion)Should the session be automatically flushed during the "before completion" phase of transaction handling.TflushMode(FlushMode flushMode)Specify the initial FlushMode to use for the opened Sessionprotected TgetThis()Tinterceptor(Interceptor interceptor)Adds a specific interceptor to the session options.TjdbcTimeZone(TimeZone timeZone)TnoInterceptor()Signifies that noInterceptorshould be used.SessionopenSession()Opens a session with the specified options.TsetQueryParameterValidation(boolean enabled)ShouldQuery.setParameter(javax.persistence.Parameter<java.time.Instant>, java.time.Instant, javax.persistence.TemporalType)perform parameter validation when the Session is bootstrapped via JPAEntityManagerFactoryTstatementInspector(StatementInspector statementInspector)Applies a specific StatementInspector to the session options.TtenantIdentifier(String tenantIdentifier)Define the tenant identifier to be associated with the opened session.
-
-
-
构造器详细资料
-
AbstractDelegatingSessionBuilder
public AbstractDelegatingSessionBuilder(SessionBuilder delegate)
-
-
方法详细资料
-
getThis
protected T getThis()
-
delegate
protected SessionBuilder delegate()
-
openSession
public Session openSession()
从接口复制的说明:SessionBuilderOpens a session with the specified options.- 指定者:
openSession在接口中SessionBuilder<T extends SessionBuilder>- 返回:
- The session
-
interceptor
public T interceptor(Interceptor interceptor)
从接口复制的说明:SessionBuilderAdds a specific interceptor to the session options.- 指定者:
interceptor在接口中SessionBuilder<T extends SessionBuilder>- 参数:
interceptor- The interceptor to use.- 返回:
this, for method chaining
-
noInterceptor
public T noInterceptor()
从接口复制的说明:SessionBuilderSignifies that noInterceptorshould be used. By default theInterceptorassociated with theSessionFactoryis passed to theSessionwhenever we open one without the user having specified a specific interceptor to use. CallingSessionBuilder.interceptor(Interceptor)with null has the same net effect.- 指定者:
noInterceptor在接口中SessionBuilder<T extends SessionBuilder>- 返回:
this, for method chaining
-
statementInspector
public T statementInspector(StatementInspector statementInspector)
从接口复制的说明:SessionBuilderApplies a specific StatementInspector to the session options.- 指定者:
statementInspector在接口中SessionBuilder<T extends SessionBuilder>- 参数:
statementInspector- The StatementInspector to use.- 返回:
this, for method chaining
-
connection
public T connection(Connection connection)
从接口复制的说明:SessionBuilderAdds a specific connection to the session options.- 指定者:
connection在接口中SessionBuilder<T extends SessionBuilder>- 参数:
connection- The connection to use.- 返回:
this, for method chaining
-
connectionReleaseMode
public T connectionReleaseMode(ConnectionReleaseMode connectionReleaseMode)
从接口复制的说明:SessionBuilderUse a specific connection release mode for these session options.- 指定者:
connectionReleaseMode在接口中SessionBuilder<T extends SessionBuilder>- 参数:
connectionReleaseMode- The connection release mode to use.- 返回:
this, for method chaining
-
autoJoinTransactions
public T autoJoinTransactions(boolean autoJoinTransactions)
从接口复制的说明:SessionBuilderShould the session built automatically join in any ongoing JTA transactions.- 指定者:
autoJoinTransactions在接口中SessionBuilder<T extends SessionBuilder>- 参数:
autoJoinTransactions- Should JTA transactions be automatically joined- 返回:
this, for method chaining- 另请参阅:
SynchronizationType.SYNCHRONIZED
-
autoClose
public T autoClose(boolean autoClose)
从接口复制的说明:SessionBuilderShould the session be automatically closed after transaction completion?- 指定者:
autoClose在接口中SessionBuilder<T extends SessionBuilder>- 参数:
autoClose- Should the session be automatically closed- 返回:
this, for method chaining- 另请参阅:
PersistenceContextType
-
flushBeforeCompletion
public T flushBeforeCompletion(boolean flushBeforeCompletion)
从接口复制的说明:SessionBuilderShould the session be automatically flushed during the "before completion" phase of transaction handling.- 指定者:
flushBeforeCompletion在接口中SessionBuilder<T extends SessionBuilder>- 参数:
flushBeforeCompletion- Should the session be automatically flushed- 返回:
this, for method chaining
-
tenantIdentifier
public T tenantIdentifier(String tenantIdentifier)
从接口复制的说明:SessionBuilderDefine the tenant identifier to be associated with the opened session.- 指定者:
tenantIdentifier在接口中SessionBuilder<T extends SessionBuilder>- 参数:
tenantIdentifier- The tenant identifier.- 返回:
this, for method chaining
-
eventListeners
public T eventListeners(SessionEventListener... listeners)
从接口复制的说明:SessionBuilderApply one or more SessionEventListener instances to the listeners for the Session to be built.- 指定者:
eventListeners在接口中SessionBuilder<T extends SessionBuilder>- 参数:
listeners- The listeners to incorporate into the built Session- 返回:
this, for method chaining
-
clearEventListeners
public T clearEventListeners()
从接口复制的说明:SessionBuilderRemove all listeners intended for the built Session currently held here, including any auto-apply ones; in other words, start with a clean slate.this, for method chaining- 指定者:
clearEventListeners在接口中SessionBuilder<T extends SessionBuilder>
-
jdbcTimeZone
public T jdbcTimeZone(TimeZone timeZone)
- 指定者:
jdbcTimeZone在接口中SessionBuilder<T extends SessionBuilder>
-
setQueryParameterValidation
public T setQueryParameterValidation(boolean enabled)
从接口复制的说明:SessionBuilderShouldQuery.setParameter(javax.persistence.Parameter<java.time.Instant>, java.time.Instant, javax.persistence.TemporalType)perform parameter validation when the Session is bootstrapped via JPAEntityManagerFactory- 指定者:
setQueryParameterValidation在接口中SessionBuilder<T extends SessionBuilder>- 参数:
enabled-trueindicates the validation should be performed,falseotherwiseThe default value is
true- 返回:
this, for method chaining
-
connectionHandlingMode
public T connectionHandlingMode(PhysicalConnectionHandlingMode mode)
从接口复制的说明:SessionBuilderSignifies that the connection release mode from the original session should be used to create the new session.- 指定者:
connectionHandlingMode在接口中SessionBuilder<T extends SessionBuilder>- 参数:
mode- The connection handling mode to use.- 返回:
this, for method chaining
-
autoClear
public T autoClear(boolean autoClear)
从接口复制的说明:SessionBuilderShould the session be automatically cleared on a failed transaction?- 指定者:
autoClear在接口中SessionBuilder<T extends SessionBuilder>- 参数:
autoClear- Whether the Session should be automatically cleared- 返回:
this, for method chaining
-
flushMode
public T flushMode(FlushMode flushMode)
从接口复制的说明:SessionBuilderSpecify the initial FlushMode to use for the opened Session- 指定者:
flushMode在接口中SessionBuilder<T extends SessionBuilder>- 参数:
flushMode- The initial FlushMode to use for the opened Session- 返回:
this, for method chaining- 另请参阅:
PersistenceContextType
-
-