Package org.hibernate
Interface StatelessSessionBuilder<T extends StatelessSessionBuilder>
-
public interface StatelessSessionBuilder<T extends StatelessSessionBuilder>Represents a consolidation of all stateless session creation options into a builder style delegate.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Tconnection(Connection connection)Adds a specific connection to the session options.StatelessSessionopenStatelessSession()Opens a session with the specified options.default TsetQueryParameterValidation(boolean enabled)ShouldQuery.setParameter(javax.persistence.Parameter<java.time.Instant>, java.time.Instant, javax.persistence.TemporalType)perform parameter validation when the Session is bootstrapped via JPAEntityManagerFactoryTtenantIdentifier(String tenantIdentifier)Define the tenant identifier to be associated with the opened session.
-
-
-
Method Detail
-
openStatelessSession
StatelessSession openStatelessSession()
Opens a session with the specified options.- Returns:
- The session
-
connection
T connection(Connection connection)
Adds a specific connection to the session options.- Parameters:
connection- The connection to use.- Returns:
this, for method chaining
-
tenantIdentifier
T tenantIdentifier(String tenantIdentifier)
Define the tenant identifier to be associated with the opened session.- Parameters:
tenantIdentifier- The tenant identifier.- Returns:
this, for method chaining
-
setQueryParameterValidation
default T setQueryParameterValidation(boolean enabled)
ShouldQuery.setParameter(javax.persistence.Parameter<java.time.Instant>, java.time.Instant, javax.persistence.TemporalType)perform parameter validation when the Session is bootstrapped via JPAEntityManagerFactory- Parameters:
enabled-trueindicates the validation should be performed,falseotherwiseThe default value is
true- Returns:
this, for method chaining
-
-