Package org.hibernate
Interface SharedSessionBuilder<T extends SharedSessionBuilder>
-
- All Superinterfaces:
SessionBuilder<T>
- All Known Implementing Classes:
AbstractDelegatingSharedSessionBuilder
public interface SharedSessionBuilder<T extends SharedSessionBuilder> extends SessionBuilder<T>
SpecializedSessionBuilderwith access to stuff from another session.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description TautoClose()Signifies that the autoClose flag from the original session should be used to create the new session.TautoClose(boolean autoClose)Should the session be automatically closed after transaction completion?TautoJoinTransactions()Signifies that the autoJoinTransaction flag from the original session should be used to create the new session.TautoJoinTransactions(boolean autoJoinTransactions)Should the session built automatically join in any ongoing JTA transactions.Tconnection()Signifies that the connection from the original session should be used to create the new session.Tconnection(Connection connection)Adds a specific connection to the session options.TconnectionHandlingMode()Signifies that the connection release mode from the original session should be used to create the new session.TconnectionReleaseMode()Deprecated.(snce 6.0) useconnectionHandlingMode()instead.TconnectionReleaseMode(ConnectionReleaseMode connectionReleaseMode)Use a specific connection release mode for these session options.default TflushBeforeCompletion()Deprecated.(since 5.2) useflushMode()instead.default TflushBeforeCompletion(boolean flushBeforeCompletion)Should the session be automatically flushed during the "before completion" phase of transaction handling.TflushMode()Signifies that the FlushMode from the original session should be used to create the new session.Tinterceptor()Signifies the interceptor from the original session should be used to create the new session.Tinterceptor(Interceptor interceptor)Adds a specific interceptor to the session options.TnoInterceptor()Signifies that noInterceptorshould be used.default TtransactionContext()Deprecated.Useconnection()instead-
Methods inherited from interface org.hibernate.SessionBuilder
autoClear, clearEventListeners, connectionHandlingMode, eventListeners, flushMode, jdbcTimeZone, openSession, setQueryParameterValidation, statementInspector, tenantIdentifier
-
-
-
-
Method Detail
-
transactionContext
@Deprecated default T transactionContext()
Deprecated.Useconnection()insteadSignifies that the transaction context from the original session should be used to create the new session.- Returns:
this, for method chaining
-
connection
T connection()
Signifies that the connection from the original session should be used to create the new session.- Returns:
this, for method chaining
-
interceptor
T interceptor()
Signifies the interceptor from the original session should be used to create the new session.- Returns:
this, for method chaining
-
connectionReleaseMode
@Deprecated T connectionReleaseMode()
Deprecated.(snce 6.0) useconnectionHandlingMode()instead.Signifies that the connection release mode from the original session should be used to create the new session.- Returns:
this, for method chaining
-
connectionHandlingMode
T connectionHandlingMode()
Signifies that the connection release mode from the original session should be used to create the new session.- Returns:
this, for method chaining
-
autoJoinTransactions
T autoJoinTransactions()
Signifies that the autoJoinTransaction flag from the original session should be used to create the new session.- Returns:
this, for method chaining
-
flushMode
T flushMode()
Signifies that the FlushMode from the original session should be used to create the new session.- Returns:
this, for method chaining
-
autoClose
T autoClose()
Signifies that the autoClose flag from the original session should be used to create the new session.- Returns:
this, for method chaining
-
flushBeforeCompletion
@Deprecated default T flushBeforeCompletion()
Deprecated.(since 5.2) useflushMode()instead.Signifies that the flushBeforeCompletion flag from the original session should be used to create the new session.- Returns:
this, for method chaining
-
interceptor
T interceptor(Interceptor interceptor)
Description copied from interface:SessionBuilderAdds a specific interceptor to the session options.- Specified by:
interceptorin interfaceSessionBuilder<T extends SharedSessionBuilder>- Parameters:
interceptor- The interceptor to use.- Returns:
this, for method chaining
-
noInterceptor
T noInterceptor()
Description copied from interface: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.- Specified by:
noInterceptorin interfaceSessionBuilder<T extends SharedSessionBuilder>- Returns:
this, for method chaining
-
connection
T connection(Connection connection)
Description copied from interface:SessionBuilderAdds a specific connection to the session options.- Specified by:
connectionin interfaceSessionBuilder<T extends SharedSessionBuilder>- Parameters:
connection- The connection to use.- Returns:
this, for method chaining
-
connectionReleaseMode
T connectionReleaseMode(ConnectionReleaseMode connectionReleaseMode)
Description copied from interface:SessionBuilderUse a specific connection release mode for these session options.- Specified by:
connectionReleaseModein interfaceSessionBuilder<T extends SharedSessionBuilder>- Parameters:
connectionReleaseMode- The connection release mode to use.- Returns:
this, for method chaining
-
autoJoinTransactions
T autoJoinTransactions(boolean autoJoinTransactions)
Description copied from interface:SessionBuilderShould the session built automatically join in any ongoing JTA transactions.- Specified by:
autoJoinTransactionsin interfaceSessionBuilder<T extends SharedSessionBuilder>- Parameters:
autoJoinTransactions- Should JTA transactions be automatically joined- Returns:
this, for method chaining- See Also:
SynchronizationType.SYNCHRONIZED
-
autoClose
T autoClose(boolean autoClose)
Description copied from interface:SessionBuilderShould the session be automatically closed after transaction completion?- Specified by:
autoClosein interfaceSessionBuilder<T extends SharedSessionBuilder>- Parameters:
autoClose- Should the session be automatically closed- Returns:
this, for method chaining- See Also:
PersistenceContextType
-
flushBeforeCompletion
default T flushBeforeCompletion(boolean flushBeforeCompletion)
Description copied from interface:SessionBuilderShould the session be automatically flushed during the "before completion" phase of transaction handling.- Specified by:
flushBeforeCompletionin interfaceSessionBuilder<T extends SharedSessionBuilder>- Parameters:
flushBeforeCompletion- Should the session be automatically flushed- Returns:
this, for method chaining
-
-