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 T
connection(java.sql.Connection connection)
Adds a specific connection to the session options.StatelessSession
openStatelessSession()
Opens a session with the specified options.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
T
tenantIdentifier(java.lang.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(java.sql.Connection connection)
Adds a specific connection to the session options.- Parameters:
connection
- The connection to use.- Returns:
this
, for method chaining
-
tenantIdentifier
T tenantIdentifier(java.lang.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
-true
indicates the validation should be performed,false
otherwiseThe default value is
true
- Returns:
this
, for method chaining
-
-