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

public abstract Class AbstractDelegatingSessionBuilder

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

Base class for SessionBuilder 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 SessionBuilder

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public SessionBuilder
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 SessionBuilder
autoClose(boolean
Should the session be automatically closed
autoClose
)

Implements org.hibernate.SessionBuilder.autoClose.

Should the session be automatically closed after transaction completion?
public SessionBuilder
autoJoinTransactions(boolean
Should JTA transactions be automatically joined
autoJoinTransactions
)

Implements org.hibernate.SessionBuilder.autoJoinTransactions.

Should the session built automatically join in any ongoing JTA transactions.
public SessionBuilder
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 SessionBuilder
connection(Connection
The connection to use.
connection
)

Implements org.hibernate.SessionBuilder.connection.

Adds a specific connection to the session options.
public SessionBuilder
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.
protected SessionBuilder
public SessionBuilder
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 SessionBuilder
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
protected SessionBuilder
public SessionBuilder
interceptor(Interceptor
The interceptor to use.
interceptor
)

Implements org.hibernate.SessionBuilder.interceptor.

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

Implements org.hibernate.SessionBuilder.noInterceptor.

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

Implements org.hibernate.SessionBuilder.openSession.

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

Implements org.hibernate.SessionBuilder.statementInspector.

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

Implements org.hibernate.SessionBuilder.tenantIdentifier.

Define the tenant identifier to be associated with the opened session.
public SessionBuilder
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 SessionBuilder delegate

Constructor Detail

AbstractDelegatingSessionBuilderback to summary
public AbstractDelegatingSessionBuilder(SessionBuilder delegate)

Method Detail

autoClearback to summary
public SessionBuilder 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:SessionBuilder

this, for method chaining

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

Implements 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:SessionBuilder

this, for method chaining

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

Implements 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:SessionBuilder

this, for method chaining

Annotations
@Override
clearEventListenersback to summary
public SessionBuilder 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:SessionBuilder

this, for method chaining

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

Implements 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:SessionBuilder

this, for method chaining

Annotations
@Override
connectionHandlingModeback to summary
public SessionBuilder 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:SessionBuilder

this, for method chaining

Annotations
@Override
delegateback to summary
protected SessionBuilder delegate()
eventListenersback to summary
public SessionBuilder 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:SessionBuilder

this, for method chaining

Annotations
@Override
flushModeback to summary
public SessionBuilder 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:SessionBuilder

this, for method chaining

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

Implements 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:SessionBuilder

this, for method chaining

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

Implements org.hibernate.SessionBuilder.jdbcTimeZone.

Annotations
@Override
noInterceptorback to summary
public SessionBuilder noInterceptor()

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

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 SessionBuilder 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:SessionBuilder

this, for method chaining

Annotations
@Override
tenantIdentifierback to summary
public SessionBuilder 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:SessionBuilder

this, for method chaining

Annotations
@Override
tenantIdentifierback to summary
public SessionBuilder 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:SessionBuilder

this, for method chaining

Annotations
@Override