Top Description Methods
org.hibernate

public Interface SharedSessionBuilder<T extends org.hibernate.SharedSessionBuilder>

extends SessionBuilder<T extends SharedSessionBuilder>
Known Direct Implementers
org.hibernate.engine.spi.AbstractDelegatingSharedSessionBuilder, org.hibernate.internal.SessionImpl.SharedSessionBuilderImpl
Imports
java.sql.Connection

Specialized SessionBuilder with access to stuff from another session.
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

this, for method chaining
autoClose
()

Signifies that the autoClose flag from the original session should be used to create the new session.

public T
autoClose(boolean
Should the session be automatically closed
autoClose
)

Redeclares org.hibernate.SessionBuilder.autoClose.

Should the session be automatically closed after transaction completion?
public T

Returns:

this, for method chaining
autoJoinTransactions
()

Signifies that the autoJoinTransaction flag from the original session should be used to create the new session.

public T
autoJoinTransactions(boolean
Should JTA transactions be automatically joined
autoJoinTransactions
)

Redeclares org.hibernate.SessionBuilder.autoJoinTransactions.

Should the session built automatically join in any ongoing JTA transactions.
public T

Returns:

this, for method chaining
connection
()

Signifies that the connection from the original session should be used to create the new session.

public T
connection(Connection
The connection to use.
connection
)

Redeclares org.hibernate.SessionBuilder.connection.

Adds a specific connection to the session options.
public T

Returns:

this, for method chaining
connectionHandlingMode
()

Signifies that the connection release mode from the original session should be used to create the new session.

public T

Returns:

this, for method chaining
connectionReleaseMode
()

Deprecated (snce 6.0) use connectionHandlingMode instead.
Signifies that the connection release mode from the original session should be used to create the new session.
public T
connectionReleaseMode(ConnectionReleaseMode
The connection release mode to use.
connectionReleaseMode
)

Redeclares org.hibernate.SessionBuilder.connectionReleaseMode.

Use a specific connection release mode for these session options.
public default T

Returns:

this, for method chaining
flushBeforeCompletion
()

Deprecated (since 5.2) use flushMode() instead.
Signifies that the flushBeforeCompletion flag from the original session should be used to create the new session.
public default T
flushBeforeCompletion(boolean
Should the session be automatically flushed
flushBeforeCompletion
)

Overrides default org.hibernate.SessionBuilder.flushBeforeCompletion.

Should the session be automatically flushed during the "before completion" phase of transaction handling.
public T

Returns:

this, for method chaining
flushMode
()

Signifies that the FlushMode from the original session should be used to create the new session.

public T

Returns:

this, for method chaining
interceptor
()

Signifies the interceptor from the original session should be used to create the new session.

public T
interceptor(Interceptor
The interceptor to use.
interceptor
)

Redeclares org.hibernate.SessionBuilder.interceptor.

Adds a specific interceptor to the session options.
public T
noInterceptor()

Redeclares org.hibernate.SessionBuilder.noInterceptor.

Signifies that no Interceptor should be used.
public default T

Returns:

this, for method chaining
transactionContext
()

Deprecated Use connection() instead
Signifies that the transaction context from the original session should be used to create the new session.
Inherited from org.hibernate.SessionBuilder:
autoClearclearEventListenersconnectionHandlingModeeventListenersflushModejdbcTimeZoneopenSessionsetQueryParameterValidationstatementInspectortenantIdentifier

Method Detail

autoCloseback to summary
public T autoClose()

Signifies that the autoClose flag from the original session should be used to create the new session.

Returns:T

this, for method chaining

autoCloseback to summary
public T autoClose(boolean autoClose)

Redeclares org.hibernate.SessionBuilder.autoClose.

Doc from org.hibernate.SessionBuilder.autoClose.

Should the session be automatically closed after transaction completion?

Parameters
autoClose:boolean

Should the session be automatically closed

Returns:T

this, for method chaining

Annotations
@Override
autoJoinTransactionsback to summary
public T autoJoinTransactions()

Signifies that the autoJoinTransaction flag from the original session should be used to create the new session.

Returns:T

this, for method chaining

autoJoinTransactionsback to summary
public T autoJoinTransactions(boolean autoJoinTransactions)

Redeclares org.hibernate.SessionBuilder.autoJoinTransactions.

Doc from org.hibernate.SessionBuilder.autoJoinTransactions.

Should the session built automatically join in any ongoing JTA transactions.

Parameters
autoJoinTransactions:boolean

Should JTA transactions be automatically joined

Returns:T

this, for method chaining

Annotations
@Override
connectionback to summary
public T connection()

Signifies that the connection from the original session should be used to create the new session.

Returns:T

this, for method chaining

connectionback to summary
public T connection(Connection connection)

Redeclares org.hibernate.SessionBuilder.connection.

Doc from org.hibernate.SessionBuilder.connection.

Adds a specific connection to the session options.

Parameters
connection:Connection

The connection to use.

Returns:T

this, for method chaining

Annotations
@Override
connectionHandlingModeback to summary
public T connectionHandlingMode()

Signifies that the connection release mode from the original session should be used to create the new session.

Returns:T

this, for method chaining

connectionReleaseModeback to summary
public T connectionReleaseMode()

Deprecated

(snce 6.0) use connectionHandlingMode instead.

Signifies that the connection release mode from the original session should be used to create the new session.

Returns:T

this, for method chaining

Annotations
@Deprecated
connectionReleaseModeback to summary
public T connectionReleaseMode(ConnectionReleaseMode connectionReleaseMode)

Redeclares org.hibernate.SessionBuilder.connectionReleaseMode.

Doc from org.hibernate.SessionBuilder.connectionReleaseMode.

Use a specific connection release mode for these session options.

Parameters
connectionReleaseMode:ConnectionReleaseMode

The connection release mode to use.

Returns:T

this, for method chaining

Annotations
@Override
flushBeforeCompletionback to summary
public default T flushBeforeCompletion()

Deprecated

(since 5.2) use flushMode() instead.

Signifies that the flushBeforeCompletion flag from the original session should be used to create the new session.

Returns:T

this, for method chaining

Annotations
@Deprecated
@SuppressWarnings:unchecked
flushBeforeCompletionback to summary
public default T flushBeforeCompletion(boolean flushBeforeCompletion)

Overrides default org.hibernate.SessionBuilder.flushBeforeCompletion.

Doc from org.hibernate.SessionBuilder.flushBeforeCompletion.

Should the session be automatically flushed during the "before completion" phase of transaction handling.

Parameters
flushBeforeCompletion:boolean

Should the session be automatically flushed

Returns:T

this, for method chaining

Annotations
@Override
flushModeback to summary
public T flushMode()

Signifies that the FlushMode from the original session should be used to create the new session.

Returns:T

this, for method chaining

interceptorback to summary
public T interceptor()

Signifies the interceptor from the original session should be used to create the new session.

Returns:T

this, for method chaining

interceptorback to summary
public T interceptor(Interceptor interceptor)

Redeclares org.hibernate.SessionBuilder.interceptor.

Doc from org.hibernate.SessionBuilder.interceptor.

Adds a specific interceptor to the session options.

Parameters
interceptor:Interceptor

The interceptor to use.

Returns:T

this, for method chaining

Annotations
@Override
noInterceptorback to summary
public T noInterceptor()

Redeclares org.hibernate.SessionBuilder.noInterceptor.

Doc from org.hibernate.SessionBuilder.noInterceptor.

Signifies that no Interceptor should be used.

By default the Interceptor associated with the SessionFactory is passed to the Session whenever we open one without the user having specified a specific interceptor to use.

Calling interceptor(Interceptor) with null has the same net effect.

Returns:T

this, for method chaining

Annotations
@Override
transactionContextback to summary
public default T transactionContext()

Deprecated

Use connection() instead

Signifies that the transaction context from the original session should be used to create the new session.

Returns:T

this, for method chaining

Annotations
@Deprecated