Package org.hibernate

Interface StatelessSessionBuilder<T extends StatelessSessionBuilder>

  • All Known Implementing Classes:
    SessionFactoryImpl.StatelessSessionBuilderImpl

    public interface StatelessSessionBuilder<T extends StatelessSessionBuilder>
    Represents a consolidation of all stateless session creation options into a builder style delegate.
    • 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)
        Should Query.setParameter(org.hibernate.query.QueryParameter<T>, T) perform parameter validation when the Session is bootstrapped via JPA EntityManagerFactory
        Parameters:
        enabled - true indicates the validation should be performed, false otherwise

        The default value is true

        Returns:
        this, for method chaining