public abstract class AbstractDelegatingSharedSessionBuilder<T extends SharedSessionBuilder> extends Object implements SharedSessionBuilder<T>
Base class for SharedSessionBuilder implementations that wish to implement only parts of that contract
themselves while forwarding other method invocations to a delegate instance.
| Constructor and Description |
|---|
AbstractDelegatingSharedSessionBuilder(SharedSessionBuilder delegate) |
| Modifier and Type | Method and Description |
|---|---|
T |
autoClear(boolean autoClear)
Should the session be automatically cleared on a failed transaction?
|
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 |
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.
|
T |
connection()
Signifies that the connection from the original session should be used to create the new session.
|
T |
connection(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 |
connectionHandlingMode(PhysicalConnectionHandlingMode mode)
Signifies that the connection release mode from the original session should be used to create the new session.
|
T |
connectionReleaseMode()
Signifies that the connection release mode from the original session should be used to create the new session.
|
T |
connectionReleaseMode(ConnectionReleaseMode connectionReleaseMode)
Use a specific connection release mode for these session options.
|
SharedSessionBuilder |
delegate() |
T |
eventListeners(SessionEventListener... listeners)
Apply one or more SessionEventListener instances to the listeners for the Session to be built.
|
T |
flushBeforeCompletion()
Signifies that the flushBeforeCompletion flag from the original session should be used to create the new session.
|
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 |
flushMode(FlushMode flushMode)
Specify the initial FlushMode to use for the opened Session
|
protected T |
getThis() |
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 |
jdbcTimeZone(TimeZone timeZone) |
T |
noInterceptor()
Signifies that no
Interceptor should be used. |
Session |
openSession()
Opens a session with the specified options.
|
T |
statementInspector(StatementInspector statementInspector)
Applies a specific StatementInspector to the session options.
|
T |
tenantIdentifier(String tenantIdentifier)
Define the tenant identifier to be associated with the opened session.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittransactionContextsetQueryParameterValidationpublic AbstractDelegatingSharedSessionBuilder(SharedSessionBuilder delegate)
protected T getThis()
public SharedSessionBuilder delegate()
public Session openSession()
SessionBuilderOpens a session with the specified options.
openSession in interface SessionBuilder<T extends SharedSessionBuilder>public T interceptor()
SharedSessionBuilderSignifies the interceptor from the original session should be used to create the new session.
interceptor in interface SharedSessionBuilder<T extends SharedSessionBuilder>this, for method chainingpublic T connection()
SharedSessionBuilderSignifies that the connection from the original session should be used to create the new session.
connection in interface SharedSessionBuilder<T extends SharedSessionBuilder>this, for method chainingpublic T connectionReleaseMode()
SharedSessionBuilderSignifies that the connection release mode from the original session should be used to create the new session.
connectionReleaseMode in interface SharedSessionBuilder<T extends SharedSessionBuilder>this, for method chainingpublic T connectionHandlingMode()
SharedSessionBuilderSignifies that the connection release mode from the original session should be used to create the new session.
connectionHandlingMode in interface SharedSessionBuilder<T extends SharedSessionBuilder>this, for method chainingpublic T autoJoinTransactions()
SharedSessionBuilderSignifies that the autoJoinTransaction flag from the original session should be used to create the new session.
autoJoinTransactions in interface SharedSessionBuilder<T extends SharedSessionBuilder>this, for method chainingpublic T autoClose()
SharedSessionBuilderSignifies that the autoClose flag from the original session should be used to create the new session.
autoClose in interface SharedSessionBuilder<T extends SharedSessionBuilder>this, for method chainingpublic T flushBeforeCompletion()
SharedSessionBuilderSignifies that the flushBeforeCompletion flag from the original session should be used to create the new session.
flushBeforeCompletion in interface SharedSessionBuilder<T extends SharedSessionBuilder>this, for method chainingpublic T interceptor(Interceptor interceptor)
SessionBuilderAdds a specific interceptor to the session options.
interceptor in interface SessionBuilder<T extends SharedSessionBuilder>interceptor - The interceptor to use.this, for method chainingpublic T noInterceptor()
SessionBuilderSignifies that no Interceptor should be used.
<p/>
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.
<p/>
Calling SessionBuilder.interceptor(Interceptor) with null has the same net effect.
noInterceptor in interface SessionBuilder<T extends SharedSessionBuilder>this, for method chainingpublic T statementInspector(StatementInspector statementInspector)
SessionBuilderApplies a specific StatementInspector to the session options.
statementInspector in interface SessionBuilder<T extends SharedSessionBuilder>statementInspector - The StatementInspector to use.this, for method chainingpublic T connection(Connection connection)
SessionBuilderAdds a specific connection to the session options.
connection in interface SessionBuilder<T extends SharedSessionBuilder>connection - The connection to use.this, for method chainingpublic T connectionReleaseMode(ConnectionReleaseMode connectionReleaseMode)
SessionBuilderUse a specific connection release mode for these session options.
connectionReleaseMode in interface SessionBuilder<T extends SharedSessionBuilder>connectionReleaseMode - The connection release mode to use.this, for method chainingpublic T autoJoinTransactions(boolean autoJoinTransactions)
SessionBuilderShould the session built automatically join in any ongoing JTA transactions.
autoJoinTransactions in interface SessionBuilder<T extends SharedSessionBuilder>autoJoinTransactions - Should JTA transactions be automatically joinedthis, for method chainingSynchronizationType.SYNCHRONIZEDpublic T autoClose(boolean autoClose)
SessionBuilderShould the session be automatically closed after transaction completion?
autoClose in interface SessionBuilder<T extends SharedSessionBuilder>autoClose - Should the session be automatically closedthis, for method chainingPersistenceContextTypepublic T flushBeforeCompletion(boolean flushBeforeCompletion)
SessionBuilderShould the session be automatically flushed during the "before completion" phase of transaction handling.
flushBeforeCompletion in interface SessionBuilder<T extends SharedSessionBuilder>flushBeforeCompletion - Should the session be automatically flushedthis, for method chainingpublic T tenantIdentifier(String tenantIdentifier)
SessionBuilderDefine the tenant identifier to be associated with the opened session.
tenantIdentifier in interface SessionBuilder<T extends SharedSessionBuilder>tenantIdentifier - The tenant identifier.this, for method chainingpublic T eventListeners(SessionEventListener... listeners)
SessionBuilderApply one or more SessionEventListener instances to the listeners for the Session to be built.
eventListeners in interface SessionBuilder<T extends SharedSessionBuilder>listeners - The listeners to incorporate into the built Sessionthis, for method chainingpublic T clearEventListeners()
SessionBuilderRemove all listeners intended for the built Session currently held here, including any auto-apply ones; in other words, start with a clean slate.
this, for method chaining
clearEventListeners in interface SessionBuilder<T extends SharedSessionBuilder>public T connectionHandlingMode(PhysicalConnectionHandlingMode mode)
SessionBuilderSignifies that the connection release mode from the original session should be used to create the new session.
connectionHandlingMode in interface SessionBuilder<T extends SharedSessionBuilder>mode - The connection handling mode to use.this, for method chainingpublic T autoClear(boolean autoClear)
SessionBuilderShould the session be automatically cleared on a failed transaction?
autoClear in interface SessionBuilder<T extends SharedSessionBuilder>autoClear - Whether the Session should be automatically clearedthis, for method chainingpublic T flushMode(FlushMode flushMode)
SessionBuilderSpecify the initial FlushMode to use for the opened Session
flushMode in interface SessionBuilder<T extends SharedSessionBuilder>flushMode - The initial FlushMode to use for the opened Sessionthis, for method chainingPersistenceContextTypepublic T flushMode()
SharedSessionBuilderSignifies that the FlushMode from the original session should be used to create the new session.
flushMode in interface SharedSessionBuilder<T extends SharedSessionBuilder>this, for method chainingpublic T jdbcTimeZone(TimeZone timeZone)
jdbcTimeZone in interface SessionBuilder<T extends SharedSessionBuilder>Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.