Package org.hibernate
Interface StatelessSessionBuilder
- All Known Implementing Classes:
SessionFactoryImpl.StatelessSessionBuilderImpl
public interface StatelessSessionBuilder
Allows creation of a new
StatelessSession with specific options.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionconnection(Connection connection) Adds a specific connection to the session options.Opens a session with the specified options.statementInspector(UnaryOperator<String> operator) Applies the given statement inspection function to the session.statementInspector(StatementInspector statementInspector) Deprecated.tenantIdentifier(Object tenantIdentifier) Define the tenant identifier to be associated with the opened session.tenantIdentifier(String tenantIdentifier) Deprecated, for removal: This API element is subject to removal in a future version.UsetenantIdentifier(Object)instead
-
Method Details
-
openStatelessSession
StatelessSession openStatelessSession()Opens a session with the specified options.- Returns:
- The session
-
connection
Adds a specific connection to the session options.- Parameters:
connection- The connection to use.- Returns:
this, for method chaining
-
tenantIdentifier
Deprecated, for removal: This API element is subject to removal in a future version.UsetenantIdentifier(Object)insteadDefine the tenant identifier to be associated with the opened session.- Parameters:
tenantIdentifier- The tenant identifier.- Returns:
this, for method chaining
-
tenantIdentifier
Define the tenant identifier to be associated with the opened session.- Parameters:
tenantIdentifier- The tenant identifier.- Returns:
this, for method chaining- Since:
- 6.4
-
statementInspector
Applies the given statement inspection function to the session.- Parameters:
operator- An operator which accepts a SQL string, returning a processed SQL string to be used by Hibernate instead of the given original SQL. Alternatively. the operator may work by side effect, and simply return the original SQL.- Returns:
this, for method chaining- API Note:
- This operation exposes the SPI type
StatementInspectorand is therefore a layer-breaker.
-
statementInspector
@Deprecated(since="7.0") StatelessSessionBuilder statementInspector(StatementInspector statementInspector) Deprecated.This operation exposes the SPI typeStatementInspectorand is therefore a layer-breaker. UsestatementInspector(UnaryOperator)instead.Applies the givenStatementInspectorto the session.- Parameters:
statementInspector- TheStatementInspectorto use.- Returns:
this, for method chaining
-
StatementInspectorand is therefore a layer-breaker.