Top Description Fields Constructors Methods
org.hibernate.engine.spi

public abstract Class AbstractDelegatingSharedSessionBuilder

extends Object
implements SharedSessionBuilder
Class Inheritance
All Implemented Interfaces
org.hibernate.SharedSessionBuilder, org.hibernate.SessionBuilder
Imports
java.sql.Connection, java.util.TimeZone, org.hibernate.FlushMode, .Interceptor, .Session, .SessionEventListener, .SharedSessionBuilder, org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode, .StatementInspector

Base class for SharedSessionBuilder implementations that wish to implement only parts of that contract themselves while forwarding other method invocations to a delegate instance.
Authors
Gunnar Morling, Guillaume Smet

Field Summary

Modifier and TypeField and Description
private final SharedSessionBuilder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public SharedSessionBuilder
autoClear(boolean
Whether the Session should be automatically cleared
autoClear
)

Implements org.hibernate.SessionBuilder.autoClear.

Should the session be automatically cleared on a failed transaction?
public SharedSessionBuilder
autoClose()

Implements org.hibernate.SharedSessionBuilder.autoClose.

Signifies that the autoClose flag from the original session should be used to create the new session.
public SharedSessionBuilder
autoClose(boolean
Should the session be automatically closed
autoClose
)

Implements org.hibernate.SharedSessionBuilder.autoClose.

Should the session be automatically closed after transaction completion?
public SharedSessionBuilder
autoJoinTransactions()

Implements org.hibernate.SharedSessionBuilder.autoJoinTransactions.

Signifies that the autoJoinTransaction flag from the original session should be used to create the new session.
public SharedSessionBuilder
autoJoinTransactions(boolean
Should JTA transactions be automatically joined
autoJoinTransactions
)

Implements org.hibernate.SharedSessionBuilder.autoJoinTransactions.

Should the session built automatically join in any ongoing JTA transactions.
public SharedSessionBuilder
clearEventListeners()

Implements org.hibernate.SessionBuilder.clearEventListeners.

Remove all listeners intended for the built session currently held here, including any auto-apply ones; in other words, start with a clean slate.
public SharedSessionBuilder
connection()

Implements org.hibernate.SharedSessionBuilder.connection.

Signifies that the connection from the original session should be used to create the new session.
public SharedSessionBuilder
connection(Connection
The connection to use.
connection
)

Implements org.hibernate.SharedSessionBuilder.connection.

Adds a specific connection to the session options.
public SharedSessionBuilder
connectionHandlingMode()

Implements org.hibernate.SharedSessionBuilder.connectionHandlingMode.

Signifies that the connection release mode from the original session should be used to create the new session.
public SharedSessionBuilder
connectionHandlingMode(PhysicalConnectionHandlingMode
The connection handling mode to use.
mode
)

Implements org.hibernate.SessionBuilder.connectionHandlingMode.

Signifies that the connection release mode from the original session should be used to create the new session.
public SharedSessionBuilder
connectionReleaseMode()

Implements org.hibernate.SharedSessionBuilder.connectionReleaseMode.

Deprecated since 6.0.
Signifies that the connection release mode from the original session should be used to create the new session.
public SharedSessionBuilder
public SharedSessionBuilder
eventListeners(SessionEventListener...
The listeners to incorporate into the built Session
listeners
)

Implements org.hibernate.SessionBuilder.eventListeners.

Add one or more SessionEventListener instances to the list of listeners for the new session to be built.
public SharedSessionBuilder
flushMode(FlushMode
The initial FlushMode to use for the opened Session
flushMode
)

Implements org.hibernate.SessionBuilder.flushMode.

Specify the initial FlushMode to use for the opened Session
public SharedSessionBuilder
flushMode()

Implements org.hibernate.SharedSessionBuilder.flushMode.

Signifies that the FlushMode from the original session should be used to create the new session.
protected SharedSessionBuilder
public SharedSessionBuilder
interceptor()

Implements org.hibernate.SharedSessionBuilder.interceptor.

Signifies the interceptor from the original session should be used to create the new session.
public SharedSessionBuilder
interceptor(Interceptor
The interceptor to use.
interceptor
)

Implements org.hibernate.SharedSessionBuilder.interceptor.

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

Implements org.hibernate.SharedSessionBuilder.noInterceptor.

Signifies that no Interceptor should be used.
public Session
openSession()

Implements org.hibernate.SessionBuilder.openSession.

Opens a session with the specified options.
public SharedSessionBuilder
statementInspector(StatementInspector
The StatementInspector to use.
statementInspector
)

Implements org.hibernate.SessionBuilder.statementInspector.

Applies the given StatementInspector to the session.
public SharedSessionBuilder
tenantIdentifier(String
The tenant identifier.
tenantIdentifier
)

Implements org.hibernate.SessionBuilder.tenantIdentifier.

Define the tenant identifier to be associated with the opened session.
public SharedSessionBuilder
tenantIdentifier(Object
The tenant identifier.
tenantIdentifier
)

Implements org.hibernate.SessionBuilder.tenantIdentifier.

Define the tenant identifier to be associated with the opened session.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

delegateback to summary
private final SharedSessionBuilder delegate

Constructor Detail

AbstractDelegatingSharedSessionBuilderback to summary
public AbstractDelegatingSharedSessionBuilder(SharedSessionBuilder delegate)

Method Detail

autoClearback to summary
public SharedSessionBuilder autoClear(boolean autoClear)

Implements org.hibernate.SessionBuilder.autoClear.

Doc from org.hibernate.SessionBuilder.autoClear.

Should the session be automatically cleared on a failed transaction?

Parameters
autoClear:boolean

Whether the Session should be automatically cleared

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
autoCloseback to summary
public SharedSessionBuilder autoClose()

Implements org.hibernate.SharedSessionBuilder.autoClose.

Doc from org.hibernate.SharedSessionBuilder.autoClose.

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

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
autoCloseback to summary
public SharedSessionBuilder autoClose(boolean autoClose)

Implements org.hibernate.SharedSessionBuilder.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:SharedSessionBuilder

this, for method chaining

Annotations
@Override
autoJoinTransactionsback to summary
public SharedSessionBuilder autoJoinTransactions()

Implements org.hibernate.SharedSessionBuilder.autoJoinTransactions.

Doc from org.hibernate.SharedSessionBuilder.autoJoinTransactions.

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

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
autoJoinTransactionsback to summary
public SharedSessionBuilder autoJoinTransactions(boolean autoJoinTransactions)

Implements org.hibernate.SharedSessionBuilder.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:SharedSessionBuilder

this, for method chaining

Annotations
@Override
clearEventListenersback to summary
public SharedSessionBuilder clearEventListeners()

Implements org.hibernate.SessionBuilder.clearEventListeners.

Doc from org.hibernate.SessionBuilder.clearEventListeners.

Remove all listeners intended for the built session currently held here, including any auto-apply ones; in other words, start with a clean slate.

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
connectionback to summary
public SharedSessionBuilder connection()

Implements org.hibernate.SharedSessionBuilder.connection.

Doc from org.hibernate.SharedSessionBuilder.connection.

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

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
connectionback to summary
public SharedSessionBuilder connection(Connection connection)

Implements org.hibernate.SharedSessionBuilder.connection.

Doc from org.hibernate.SessionBuilder.connection.

Adds a specific connection to the session options.

Parameters
connection:Connection

The connection to use.

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
connectionHandlingModeback to summary
public SharedSessionBuilder connectionHandlingMode()

Implements org.hibernate.SharedSessionBuilder.connectionHandlingMode.

Doc from org.hibernate.SharedSessionBuilder.connectionHandlingMode.

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

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
connectionHandlingModeback to summary
public SharedSessionBuilder connectionHandlingMode(PhysicalConnectionHandlingMode mode)

Implements org.hibernate.SessionBuilder.connectionHandlingMode.

Doc from org.hibernate.SessionBuilder.connectionHandlingMode.

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

Parameters
mode:PhysicalConnectionHandlingMode

The connection handling mode to use.

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
connectionReleaseModeback to summary
public SharedSessionBuilder connectionReleaseMode()

Implements org.hibernate.SharedSessionBuilder.connectionReleaseMode.

Doc from org.hibernate.SharedSessionBuilder.connectionReleaseMode.

Deprecated

since 6.0.

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

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
@Deprecated
since:6.0
delegateback to summary
public SharedSessionBuilder delegate()
eventListenersback to summary
public SharedSessionBuilder eventListeners(SessionEventListener... listeners)

Implements org.hibernate.SessionBuilder.eventListeners.

Doc from org.hibernate.SessionBuilder.eventListeners.

Add one or more SessionEventListener instances to the list of listeners for the new session to be built.

Parameters
listeners:SessionEventListener[]

The listeners to incorporate into the built Session

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
flushModeback to summary
public SharedSessionBuilder flushMode(FlushMode flushMode)

Implements org.hibernate.SessionBuilder.flushMode.

Doc from org.hibernate.SessionBuilder.flushMode.

Specify the initial FlushMode to use for the opened Session

Parameters
flushMode:FlushMode

The initial FlushMode to use for the opened Session

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
flushModeback to summary
public SharedSessionBuilder flushMode()

Implements org.hibernate.SharedSessionBuilder.flushMode.

Doc from org.hibernate.SharedSessionBuilder.flushMode.

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

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
getThisback to summary
protected SharedSessionBuilder getThis()
interceptorback to summary
public SharedSessionBuilder interceptor()

Implements org.hibernate.SharedSessionBuilder.interceptor.

Doc from org.hibernate.SharedSessionBuilder.interceptor.

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

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
interceptorback to summary
public SharedSessionBuilder interceptor(Interceptor interceptor)

Implements org.hibernate.SharedSessionBuilder.interceptor.

Doc from org.hibernate.SessionBuilder.interceptor.

Adds a specific interceptor to the session options.

Parameters
interceptor:Interceptor

The interceptor to use.

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
jdbcTimeZoneback to summary
public SharedSessionBuilder jdbcTimeZone(TimeZone timeZone)

Implements org.hibernate.SessionBuilder.jdbcTimeZone.

Annotations
@Override
noInterceptorback to summary
public SharedSessionBuilder noInterceptor()

Implements org.hibernate.SharedSessionBuilder.noInterceptor.

Doc from org.hibernate.SessionBuilder.noInterceptor.

Signifies that no Interceptor should be used.

By default, if no Interceptor is explicitly specified, the Interceptor associated with the SessionFactory is inherited by the new Session.

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

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
openSessionback to summary
public Session openSession()

Implements org.hibernate.SessionBuilder.openSession.

Doc from org.hibernate.SessionBuilder.openSession.

Opens a session with the specified options.

Returns:Session

The session

Annotations
@Override
statementInspectorback to summary
public SharedSessionBuilder statementInspector(StatementInspector statementInspector)

Implements org.hibernate.SessionBuilder.statementInspector.

Doc from org.hibernate.SessionBuilder.statementInspector.

Applies the given StatementInspector to the session.

Parameters
statementInspector:StatementInspector

The StatementInspector to use.

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
tenantIdentifierback to summary
public SharedSessionBuilder tenantIdentifier(String tenantIdentifier)

Implements org.hibernate.SessionBuilder.tenantIdentifier.

Doc from org.hibernate.SessionBuilder.tenantIdentifier.

Define the tenant identifier to be associated with the opened session.

Parameters
tenantIdentifier:String

The tenant identifier.

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override
tenantIdentifierback to summary
public SharedSessionBuilder tenantIdentifier(Object tenantIdentifier)

Implements org.hibernate.SessionBuilder.tenantIdentifier.

Doc from org.hibernate.SessionBuilder.tenantIdentifier.

Define the tenant identifier to be associated with the opened session.

Parameters
tenantIdentifier:Object

The tenant identifier.

Returns:SharedSessionBuilder

this, for method chaining

Annotations
@Override