public abstract class AbstractDelegatingSessionBuilder extends Object implements SessionBuilder
SessionBuilder
implementations that wish to implement only parts of that contract themselves
while forwarding other method invocations to a delegate instance.Constructor and Description |
---|
AbstractDelegatingSessionBuilder(SessionBuilder delegate) |
Modifier and Type | Method and Description |
---|---|
SessionBuilder |
autoClose(boolean autoClose)
Should the session be automatically closed after transaction completion.
|
SessionBuilder |
autoJoinTransactions(boolean autoJoinTransactions)
Should the session built automatically join in any ongoing JTA transactions.
|
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.
|
SessionBuilder |
connection(Connection connection)
Adds a specific connection to the session options.
|
SessionBuilder |
connectionReleaseMode(ConnectionReleaseMode connectionReleaseMode)
Use a specific connection release mode for these session options.
|
SessionBuilder |
eventListeners(SessionEventListener... listeners)
Apply one or more SessionEventListener instances to the listeners for the Session to be built.
|
SessionBuilder |
flushBeforeCompletion(boolean flushBeforeCompletion)
Should the session be automatically flushed during the "before completion" phase of transaction handling.
|
SessionBuilder |
interceptor(Interceptor interceptor)
Adds a specific interceptor to the session options.
|
SessionBuilder |
noInterceptor()
Signifies that no
Interceptor should be used. |
Session |
openSession()
Opens a session with the specified options.
|
SessionBuilder |
statementInspector(StatementInspector statementInspector)
Applies a specific StatementInspector to the session options.
|
SessionBuilder |
tenantIdentifier(String tenantIdentifier)
Define the tenant identifier to be associated with the opened session.
|
public AbstractDelegatingSessionBuilder(SessionBuilder delegate)
public Session openSession()
SessionBuilder
openSession
in interface SessionBuilder
public SessionBuilder interceptor(Interceptor interceptor)
SessionBuilder
interceptor
in interface SessionBuilder
interceptor
- The interceptor to use.this
, for method chainingpublic SessionBuilder noInterceptor()
SessionBuilder
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 SessionBuilder.interceptor(Interceptor)
with null has the same net effect.noInterceptor
in interface SessionBuilder
this
, for method chainingpublic SessionBuilder statementInspector(StatementInspector statementInspector)
SessionBuilder
statementInspector
in interface SessionBuilder
statementInspector
- The StatementInspector to use.this
, for method chainingpublic SessionBuilder connection(Connection connection)
SessionBuilder
connection
in interface SessionBuilder
connection
- The connection to use.this
, for method chainingpublic SessionBuilder connectionReleaseMode(ConnectionReleaseMode connectionReleaseMode)
SessionBuilder
connectionReleaseMode
in interface SessionBuilder
connectionReleaseMode
- The connection release mode to use.this
, for method chainingpublic SessionBuilder autoJoinTransactions(boolean autoJoinTransactions)
SessionBuilder
autoJoinTransactions
in interface SessionBuilder
autoJoinTransactions
- Should JTA transactions be automatically joinedthis
, for method chainingpublic SessionBuilder autoClose(boolean autoClose)
SessionBuilder
autoClose
in interface SessionBuilder
autoClose
- Should the session be automatically closedthis
, for method chainingpublic SessionBuilder flushBeforeCompletion(boolean flushBeforeCompletion)
SessionBuilder
flushBeforeCompletion
in interface SessionBuilder
flushBeforeCompletion
- Should the session be automatically flushedthis
, for method chainingpublic SessionBuilder tenantIdentifier(String tenantIdentifier)
SessionBuilder
tenantIdentifier
in interface SessionBuilder
tenantIdentifier
- The tenant identifier.this
, for method chainingpublic SessionBuilder eventListeners(SessionEventListener... listeners)
SessionBuilder
eventListeners
in interface SessionBuilder
listeners
- The listeners to incorporate into the built Sessionthis
, for method chainingpublic SessionBuilder clearEventListeners()
SessionBuilder
this
, for method chainingclearEventListeners
in interface SessionBuilder
Copyright © 2016 JBoss by Red Hat. All rights reserved.