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>
SpecializedSessionBuilder
with access to stuff from another session.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description T
autoClose()
Signifies that the autoClose flag from the original session should be used to create the new session.T
autoClose(boolean autoClose)
Should the session be automatically closed after transaction completion?T
autoJoinTransactions()
Signifies that the autoJoinTransaction flag from the original session should be used to create the new session.T
autoJoinTransactions(boolean autoJoinTransactions)
Should the session built automatically join in any ongoing JTA transactions.T
connection()
Signifies that the connection from the original session should be used to create the new session.T
connection(java.sql.Connection connection)
Adds a specific connection to the session options.T
connectionHandlingMode()
Signifies that the connection release mode from the original session should be used to create the new session.T
connectionReleaseMode()
Deprecated.(snce 6.0) useconnectionHandlingMode()
instead.T
connectionReleaseMode(ConnectionReleaseMode connectionReleaseMode)
Use a specific connection release mode for these session options.default T
flushBeforeCompletion()
Deprecated.(since 5.2) useflushMode()
instead.default T
flushBeforeCompletion(boolean flushBeforeCompletion)
Should the session be automatically flushed during the "before completion" phase of transaction handling.T
flushMode()
Signifies that the FlushMode from the original session should be used to create the new session.T
interceptor()
Signifies the interceptor from the original session should be used to create the new session.T
interceptor(Interceptor interceptor)
Adds a specific interceptor to the session options.T
noInterceptor()
Signifies that noInterceptor
should be used.default T
transactionContext()
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:SessionBuilder
Adds a specific interceptor to the session options.- Specified by:
interceptor
in interfaceSessionBuilder<T extends SharedSessionBuilder>
- Parameters:
interceptor
- The interceptor to use.- Returns:
this
, for method chaining
-
noInterceptor
T noInterceptor()
Description copied from interface:SessionBuilder
Signifies that noInterceptor
should be used. By default theInterceptor
associated with theSessionFactory
is passed to theSession
whenever 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:
noInterceptor
in interfaceSessionBuilder<T extends SharedSessionBuilder>
- Returns:
this
, for method chaining
-
connection
T connection(java.sql.Connection connection)
Description copied from interface:SessionBuilder
Adds a specific connection to the session options.- Specified by:
connection
in interfaceSessionBuilder<T extends SharedSessionBuilder>
- Parameters:
connection
- The connection to use.- Returns:
this
, for method chaining
-
connectionReleaseMode
T connectionReleaseMode(ConnectionReleaseMode connectionReleaseMode)
Description copied from interface:SessionBuilder
Use a specific connection release mode for these session options.- Specified by:
connectionReleaseMode
in 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:SessionBuilder
Should the session built automatically join in any ongoing JTA transactions.- Specified by:
autoJoinTransactions
in 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:SessionBuilder
Should the session be automatically closed after transaction completion?- Specified by:
autoClose
in 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:SessionBuilder
Should the session be automatically flushed during the "before completion" phase of transaction handling.- Specified by:
flushBeforeCompletion
in interfaceSessionBuilder<T extends SharedSessionBuilder>
- Parameters:
flushBeforeCompletion
- Should the session be automatically flushed- Returns:
this
, for method chaining
-
-