类 SessionFactoryImpl.SessionBuilderImpl<T extends SessionBuilder>
- java.lang.Object
-
- org.hibernate.internal.SessionFactoryImpl.SessionBuilderImpl<T>
-
- 所有已实现的接口:
SessionBuilderImplementor<T>,SessionCreationOptions,SessionBuilder<T>
- 封闭类:
- SessionFactoryImpl
public static class SessionFactoryImpl.SessionBuilderImpl<T extends SessionBuilder> extends Object implements SessionBuilderImplementor<T>, SessionCreationOptions
-
-
构造器概要
构造器 构造器 说明 SessionBuilderImpl(SessionFactoryImpl sessionFactory)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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 connectionHandlingMode)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.TeventListeners(SessionEventListener... listeners)Apply one or more SessionEventListener instances to the listeners for the Session to be built.TflushMode(FlushMode flushMode)Specify the initial FlushMode to use for the opened SessionAfterCompletionActiongetAfterCompletionAction()ConnectiongetConnection()List<SessionEventListener>getCustomSessionEventListener()ExceptionMappergetExceptionMapper()FlushModegetInitialSessionFlushMode()InterceptorgetInterceptor()TimeZonegetJdbcTimeZone()ManagedFlushCheckergetManagedFlushChecker()PhysicalConnectionHandlingModegetPhysicalConnectionHandlingMode()SessionOwnergetSessionOwner()Access to the SessionOwner, which defines the contract for things that can wrap a SessionStatementInspectorgetStatementInspector()StringgetTenantIdentifier()Tinterceptor(Interceptor interceptor)Adds a specific interceptor to the session options.booleanisQueryParametersValidationEnabled()TjdbcTimeZone(TimeZone timeZone)TnoInterceptor()Signifies that noInterceptorshould be used.SessionopenSession()Opens a session with the specified options.Towner(SessionOwner sessionOwner)Adds the session owner to the session optionsTsetQueryParameterValidation(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 JPAEntityManagerFactorybooleanshouldAutoClear()booleanshouldAutoClose()booleanshouldAutoJoinTransactions()TstatementInspector(StatementInspector statementInspector)Applies a specific StatementInspector to the session options.TtenantIdentifier(String tenantIdentifier)Define the tenant identifier to be associated with the opened session.-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.SessionBuilder
flushBeforeCompletion
-
-
-
-
构造器详细资料
-
SessionBuilderImpl
public SessionBuilderImpl(SessionFactoryImpl sessionFactory)
-
-
方法详细资料
-
getSessionOwner
public SessionOwner getSessionOwner()
从接口复制的说明:SessionCreationOptionsAccess to the SessionOwner, which defines the contract for things that can wrap a Session- 指定者:
getSessionOwner在接口中SessionCreationOptions- 返回:
- Always returns null.
-
getExceptionMapper
public ExceptionMapper getExceptionMapper()
- 指定者:
getExceptionMapper在接口中SessionCreationOptions
-
getAfterCompletionAction
public AfterCompletionAction getAfterCompletionAction()
-
getManagedFlushChecker
public ManagedFlushChecker getManagedFlushChecker()
- 指定者:
getManagedFlushChecker在接口中SessionCreationOptions
-
isQueryParametersValidationEnabled
public boolean isQueryParametersValidationEnabled()
-
shouldAutoJoinTransactions
public boolean shouldAutoJoinTransactions()
-
getInitialSessionFlushMode
public FlushMode getInitialSessionFlushMode()
-
shouldAutoClose
public boolean shouldAutoClose()
- 指定者:
shouldAutoClose在接口中SessionCreationOptions
-
shouldAutoClear
public boolean shouldAutoClear()
- 指定者:
shouldAutoClear在接口中SessionCreationOptions
-
getConnection
public Connection getConnection()
- 指定者:
getConnection在接口中SessionCreationOptions
-
getInterceptor
public Interceptor getInterceptor()
- 指定者:
getInterceptor在接口中SessionCreationOptions
-
getStatementInspector
public StatementInspector getStatementInspector()
- 指定者:
getStatementInspector在接口中SessionCreationOptions
-
getPhysicalConnectionHandlingMode
public PhysicalConnectionHandlingMode getPhysicalConnectionHandlingMode()
-
getTenantIdentifier
public String getTenantIdentifier()
- 指定者:
getTenantIdentifier在接口中SessionCreationOptions
-
getJdbcTimeZone
public TimeZone getJdbcTimeZone()
- 指定者:
getJdbcTimeZone在接口中SessionCreationOptions
-
getCustomSessionEventListener
public List<SessionEventListener> getCustomSessionEventListener()
- 指定者:
getCustomSessionEventListener在接口中SessionCreationOptions- 返回:
- the full list of SessionEventListener if this was customized, or null if this Session is being created with the default list.
-
openSession
public Session openSession()
从接口复制的说明:SessionBuilderOpens a session with the specified options.- 指定者:
openSession在接口中SessionBuilder<T extends SessionBuilder>- 返回:
- The session
-
owner
public T owner(SessionOwner sessionOwner)
从接口复制的说明:SessionBuilderImplementorAdds the session owner to the session options- 指定者:
owner在接口中SessionBuilderImplementor<T extends SessionBuilder>- 参数:
sessionOwner- The session owner.- 返回:
this, for method chaining
-
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
-
connectionHandlingMode
public T connectionHandlingMode(PhysicalConnectionHandlingMode connectionHandlingMode)
从接口复制的说明:SessionBuilderSignifies that the connection release mode from the original session should be used to create the new session.- 指定者:
connectionHandlingMode在接口中SessionBuilder<T extends SessionBuilder>- 参数:
connectionHandlingMode- The connection handling 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
-
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
-
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
-
-