diff --git a/hibernate-core/src/main/java/org/hibernate/EnabledFetchProfile.java b/hibernate-core/src/main/java/org/hibernate/EnabledFetchProfile.java index b26ed6b4c48f..2ea2858bb5bd 100644 --- a/hibernate-core/src/main/java/org/hibernate/EnabledFetchProfile.java +++ b/hibernate-core/src/main/java/org/hibernate/EnabledFetchProfile.java @@ -7,59 +7,60 @@ import jakarta.persistence.FindOption; import org.hibernate.query.SelectionQuery; -/** - * A {@link jakarta.persistence.FindOption} which requests a named - * {@linkplain org.hibernate.annotations.FetchProfile fetch profile}. - *

- * An instance of this class may be obtained in a type safe way - * from the static metamodel for the class annotated - * {@link org.hibernate.annotations.FetchProfile @FetchProfile}. - *

- * For example, this class defines a fetch profile: - *

- * @Entity
- * @FetchProfile(name = "WithAuthors")
- * class Book {
- *     ...
- *
- *     @ManyToMany
- *     @FetchProfileOverride(profile = Book_.PROFILE_WITH_AUTHORS)
- *     Set<Author> authors;
- * }
- * 
- *

- * An {@code EnabledFetchProfile} may be obtained from the static - * metamodel for the entity {@code Book} and passed as an option to - * {@link Session#find(Class, Object, FindOption...) find()}. - *

- * Book bookWithAuthors =
- *         session.find(Book.class, isbn, Book_._WithAuthors)
- * 
- * Alternatively, it may be {@linkplain #enable(Session) applied} - * to a {@code Session} or {@code Query}. - *
- * Book_._WithAuthors.enable(session);
- * Book bookWithAuthors = session.find(Book.class, isbn);
- * 
- *

- * When the static metamodel is not used, an {@code EnabledFetchProfile} - * may be instantiated directly, passing the name of the fetch profile - * as a string. - *

- * Book bookWithAuthors =
- *         session.find(Book.class, isbn,
- *                      new EnabledFetchProfile("WithAuthors"))
- * 
- * - * @param profileName the {@linkplain org.hibernate.annotations.FetchProfile#name profile name} - * - * @since 7.0 - * - * @see org.hibernate.annotations.FetchProfile - * @see Session#find(Class, Object, FindOption...) - * - * @author Gavin King - */ +/// A [jakarta.persistence.FindOption] which represents a named +/// [fetch profile][org.hibernate.annotations.FetchProfile]. +/// +/// An instance of this class may be obtained in a type safe way +/// from the static metamodel for the class annotated with the +/// [@FetchProfile][org.hibernate.annotations.FetchProfile]. +/// +/// For example, this class defines a fetch profile: +/// ```java +/// @Entity +/// @FetchProfile(name = "WithAuthors") +/// class Book { +/// ... +/// @ManyToMany +/// @FetchProfileOverride(profile = Book_.PROFILE_WITH_AUTHORS) +/// Set authors; +/// } +/// ``` +/// +/// An `EnabledFetchProfile` may be obtained from the static +/// metamodel for the entity {@code Book} and passed as an option to +/// [Session#find(Class, Object, FindOption...)]. +/// +/// ```java +/// Book bookWithAuthors = +/// session.find(Book.class, isbn, Book_._WithAuthors) +/// ``` +/// +/// Alternatively, it may be [applied][#enable(Session)] +/// to a `Session` or `Query`. +/// +/// ```java +/// Book_._WithAuthors.enable(session); +/// Book bookWithAuthors = session.find(Book.class, isbn); +/// ``` +/// +/// When the static metamodel is not used, an `EnabledFetchProfile` +/// may be instantiated directly, passing the name of the fetch profile +/// as a string. +/// +/// ```java +/// Book bookWithAuthors = +/// session.find(Book.class, isbn, +/// new EnabledFetchProfile("WithAuthors")) +/// ``` +/// +/// @param profileName the [profile name][org.hibernate.annotations.FetchProfile#name]. +/// +/// @since 7.0 +/// +/// @see org.hibernate.annotations.FetchProfile +/// @see Session#find(Class, Object, FindOption...) +/// +/// @author Gavin King public record EnabledFetchProfile(String profileName) implements FindOption { diff --git a/hibernate-core/src/main/java/org/hibernate/IdentifierLoadAccess.java b/hibernate-core/src/main/java/org/hibernate/IdentifierLoadAccess.java index 6e544faaad54..a9b8f294371c 100644 --- a/hibernate-core/src/main/java/org/hibernate/IdentifierLoadAccess.java +++ b/hibernate-core/src/main/java/org/hibernate/IdentifierLoadAccess.java @@ -12,88 +12,73 @@ import jakarta.persistence.Timeout; import org.hibernate.graph.GraphSemantic; -/** - * Loads an entity by its primary identifier. - *

- * The interface is especially useful when customizing association - * fetching using an {@link jakarta.persistence.EntityGraph}. - *

- * var graph = session.createEntityGraph(Book.class);
- * graph.addSubgraph(Book_.publisher);
- * graph.addPluralSubgraph(Book_.authors)
- *     .addSubgraph(Author_.person);
- *
- * Book book =
- *         session.byId(Book.class)
- *             .withFetchGraph(graph)
- *             .load(bookId);
- * 
- *

- * It's also useful for loading entity instances with a specific - * {@linkplain CacheMode cache interaction mode} in effect, or in - * {@linkplain Session#setReadOnly(Object, boolean) read-only mode}. - *

- * Book book =
- *         session.byId(Book.class)
- *             .with(CacheMode.GET)
- *             .withReadOnly(true)
- *             .load(bookId);
- * 
- * - * @author Eric Dalquist - * @author Steve Ebersole - * - * @see Session#byId - * - * @deprecated Use forms of {@linkplain Session#find} accepting - * {@linkplain jakarta.persistence.FindOption} instead of {@linkplain Session#byId}. - */ +/// Loads an entity by its primary identifier. +/// +/// The interface is especially useful when customizing association +/// fetching using an [jakarta.persistence.EntityGraph]. +/// ```java +/// var graph = session.createEntityGraph(Book.class); +/// graph.addSubgraph(Book_.publisher); +/// graph.addPluralSubgraph(Book_.authors) +/// .addSubgraph(Author_.person); +/// Book book = session.byId(Book.class) +/// .withFetchGraph(graph) +/// .load(bookId); +/// ``` +/// +/// It's also useful for loading entity instances with a specific +/// [cache interaction mode][CacheMode] in effect, or in +/// [read-only mode][Session#setReadOnly(Object, boolean)]. +/// +/// ```java +/// Book book = session.byId(Book.class) +/// .with(CacheMode.GET) +/// .withReadOnly(true) +/// .load(bookId); +/// ``` +/// +/// @author Eric Dalquist +/// @author Steve Ebersole +/// +/// @see Session#byId +/// +/// @deprecated Use forms of [Session#find] accepting [jakarta.persistence.FindOption]} instead. @Deprecated(since = "7.1", forRemoval = true) public interface IdentifierLoadAccess { - /** - * Specify the {@linkplain LockMode lock mode} to use when - * querying the database. - * - * @param lockMode The lock mode to apply - * @return {@code this}, for method chaining - */ + /// Specify the [lock mode][LockMode] to use when querying the database. + /// + /// @param lockMode The lock mode to apply + /// + /// @return `this`, for method chaining default IdentifierLoadAccess with(LockMode lockMode) { return with( lockMode, PessimisticLockScope.NORMAL ); } - /** - * Specify the {@linkplain LockMode lock mode} to use when - * querying the database. - * - * @param lockMode The lock mode to apply - * - * @return {@code this}, for method chaining - */ + /// Specify the [lock mode][LockMode] and [scope][PessimisticLockScope] to use when querying the database. + /// + /// @param lockMode The lock mode to apply + /// @param lockScope The locking scope (how much to lock). + /// + /// @return `this`, for method chaining IdentifierLoadAccess with(LockMode lockMode, PessimisticLockScope lockScope); - /** - * Specify the {@linkplain Timeout timeout} to use when - * querying the database. - * - * @param timeout The timeout to apply to the database operation - * - * @return {@code this}, for method chaining - */ + /// Specify the [timeout][Timeout] to use when querying the database. + /// + /// @param timeout The timeout to apply to the database operation + /// + /// @return `this`, for method chaining IdentifierLoadAccess with(Timeout timeout); - /** - * Specify the {@linkplain LockOptions lock options} to use when - * querying the database. - * - * @param lockOptions The lock options to use - * - * @return {@code this}, for method chaining - * - * @deprecated Use one of {@linkplain #with(LockMode)}, - * {@linkplain #with(LockMode, PessimisticLockScope)} - * and/or {@linkplain #with(Timeout)} instead. - */ + /// Specify the [lock options][LockOptions] to use when querying the database. + /// + /// @param lockOptions The lock options to use + /// + /// @return `this`, for method chaining + /// + /// @deprecated Use one of [#with(LockMode)], + /// [#with(LockMode, PessimisticLockScope)] + /// and/or [#with(Timeout)] instead. @Deprecated(since = "7.0", forRemoval = true) IdentifierLoadAccess with(LockOptions lockOptions); diff --git a/hibernate-core/src/main/java/org/hibernate/SessionBuilder.java b/hibernate-core/src/main/java/org/hibernate/SessionBuilder.java index d6892e78b0bc..b5c8dc56b255 100644 --- a/hibernate-core/src/main/java/org/hibernate/SessionBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/SessionBuilder.java @@ -12,39 +12,38 @@ import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode; import org.hibernate.resource.jdbc.spi.StatementInspector; -/** - * Allows creation of a new {@link Session} with specific options - * overriding the defaults from the {@link SessionFactory}. - *
- * try (var session =
- *         sessionFactory.withOptions()
- *             .tenantIdentifier(tenantId)
- *             .initialCacheMode(CacheMode.PUT)
- *             .flushMode(FlushMode.COMMIT)
- *             .interceptor(new Interceptor() {
- *                 @Override
- *                 public void preFlush(Iterator<Object> entities) {
- *                     ...
- *                 }
- *             })
- *             .openSession()) {
- *     ...
- * }
- * 
- * - * @author Steve Ebersole - * - * @see SessionFactory#withOptions() - * @see SharedSessionBuilder - */ +/// Allows creation of a new [Session] with specific options +/// overriding the defaults from the [SessionFactory]. +/// +/// ```java +/// try (var session = sessionFactory.withOptions() +/// .tenantIdentifier(tenantId) +/// .initialCacheMode(CacheMode.PUT) +/// .flushMode(FlushMode.COMMIT) +/// .interceptor(new Interceptor() { +/// @Override +/// public void preFlush(Iterator entities) { +/// ... +/// } +/// }) +/// .openSession()) { +/// ... +/// } +/// } +/// @author Steve Ebersole +/// +/// @see SessionFactory#withOptions() +/// @see SharedSessionBuilder public interface SessionBuilder extends CommonBuilder { - /** - * Opens a session with the specified options. - * - * @return The session - */ + /// Open the session using the specified options. + /// @see #open Session openSession(); + @Override + default Session open() { + return openSession(); + } + @Override SessionBuilder interceptor(Interceptor interceptor); diff --git a/hibernate-core/src/main/java/org/hibernate/engine/creation/CommonBuilder.java b/hibernate-core/src/main/java/org/hibernate/engine/creation/CommonBuilder.java index 44c2bc631295..dc9aedb051ec 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/creation/CommonBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/creation/CommonBuilder.java @@ -10,7 +10,6 @@ import org.hibernate.Incubating; import org.hibernate.Interceptor; import org.hibernate.Session; -import org.hibernate.SessionFactory; import org.hibernate.SharedSessionContract; import org.hibernate.StatelessSession; @@ -28,187 +27,147 @@ */ @Incubating public interface CommonBuilder { + /// Open the session using the specified options. + SharedSessionContract open(); - /** - * Adds a specific connection to the session options. - * - * @param connection The connection to use. - * - * @return {@code this}, for method chaining - */ + /// Adds a specific connection to be used to the session options. + /// + /// @param connection The connection to use. + /// @return {@code this}, for method chaining CommonBuilder connection(Connection connection); - /** - * Specifies the connection handling modes for the session. - *

- * Note that if {@link ConnectionAcquisitionMode#IMMEDIATELY} is specified, - * then the release mode must be {@link ConnectionReleaseMode#ON_CLOSE}. - * - * @return {@code this}, for method chaining - * - * @since 7.0 - */ + /// Specifies the connection handling modes for the session. + /// + /// @apiNote If [ConnectionAcquisitionMode#IMMEDIATELY] is specified, + /// then the release mode must be [ConnectionReleaseMode#ON_CLOSE]. + /// + /// @return `this`, for method chaining + /// + /// @since 7.0 CommonBuilder connectionHandling(ConnectionAcquisitionMode acquisitionMode, ConnectionReleaseMode releaseMode); - /** - * Adds a specific interceptor to the session options. - * - * @param interceptor The interceptor to use. - * - * @return {@code this}, for method chaining - */ + /// Adds a specific interceptor to the session options. + /// + /// @param interceptor The interceptor to use. + /// @return `this`, for method chaining CommonBuilder interceptor(Interceptor interceptor); - /** - * Specifies that no {@link Interceptor} should be used. - *

- * By default, if no {@code Interceptor} is explicitly - * {@linkplain #interceptor(Interceptor) specified}, the - * {@code Interceptor} associated with the {@link SessionFactory} is - * inherited by the new session. Or, if there is no interceptor - * associated with the {@link SessionFactory}, but a session-scoped - * interceptor has been configured, a new session-scoped - * {@code Interceptor} will be created for the new session. - *

- * Calling {@link #interceptor(Interceptor) interceptor(null)} has the - * same effect. - * - * @return {@code this}, for method chaining - */ + /// Specifies that no {@link Interceptor} should be used. This indicates to + /// ignore both (if either) the [interceptor][org.hibernate.cfg.SessionEventSettings#INTERCEPTOR] + /// and [session-scoped interceptor][org.hibernate.cfg.SessionEventSettings#SESSION_SCOPED_INTERCEPTOR] + /// associated with the `SessionFactory` + /// + /// @return `this`, for method chaining + /// + /// @apiNote Calling [#interceptor(Interceptor)] with `null` has the same effect CommonBuilder noInterceptor(); - /** - * Specifies that no - * {@linkplain org.hibernate.cfg.SessionEventSettings#SESSION_SCOPED_INTERCEPTOR - * session-scoped interceptor} should be instantiated for the new session. - *

- * By default, if no {@link Interceptor} is explicitly - * {@linkplain #interceptor(Interceptor) specified}, and if there - * is no interceptor associated with the {@link SessionFactory}, but - * a session-scoped interceptor has been configured, a new session-scoped - * {@code Interceptor} will be created for the new session. - *

- * Note that this operation does not disable use of an interceptor - * associated with the {@link SessionFactory}. - * - * @return {@code this}, for method chaining - * - * @see org.hibernate.cfg.SessionEventSettings#SESSION_SCOPED_INTERCEPTOR - * - * @since 7.2 - */ + /// Specifies that no [session-scoped interceptor][org.hibernate.cfg.SessionEventSettings#SESSION_SCOPED_INTERCEPTOR] + /// should be used for the session. If the `SessionFactory` has a configured + /// [interceptor][org.hibernate.cfg.SessionEventSettings#INTERCEPTOR], it will still be used. + /// + /// @return `this`, for method chaining + /// + /// @see #noInterceptor + /// + /// @apiNote Unlike [#noInterceptor], this operation does not disable use of an + /// [interceptor][org.hibernate.cfg.SessionEventSettings#INTERCEPTOR] associated with the `SessionFactory`. + /// + /// @since 7.2 CommonBuilder noSessionInterceptorCreation(); - /** - * Applies the given statement inspection function to the session. - * - * @param operator An operator which accepts a SQL string, returning - * a processed SQL string to be used by Hibernate instead of the given - * original SQL. The operator may simply return the original SQL. - * - * @return {@code this}, for method chaining - */ + /// Applies the given statement inspection function to the session. + /// + /// @param operator An operator which accepts a SQL string, returning + /// a processed SQL string to be used by Hibernate instead. The + /// operator may simply (and usually) return the original SQL. + /// + /// @return `this`, for method chaining CommonBuilder statementInspector(UnaryOperator operator); - /** - * Signifies that no SQL statement inspector should be used. - *

- * By default, if no inspector is explicitly specified, the - * inspector associated with the {@link SessionFactory} is - * inherited by the new session. - *

- * Calling {@link #interceptor(Interceptor)} with null has the same effect. - * - * @return {@code this}, for method chaining - */ + /// Signifies that no SQL statement inspector should be used. + /// + /// By default, if no inspector is explicitly specified, the + /// inspector associated with the {@link org.hibernate.SessionFactory}, if one, is + /// inherited by the new session. + /// + /// @return `this`, for method chaining + /// + /// @apiNote Calling [#statementInspector] with `null` has the same effect. CommonBuilder noStatementInspector(); - /** - * Specify the tenant identifier to be associated with the opened session. - *

-	 * try (var session =
-	 *         sessionFactory.withOptions()
-	 *             .tenantIdentifier(tenantId)
-	 *             .openSession()) {
-	 *     ...
-	 * }
-	 * 
- * - * @param tenantIdentifier The tenant identifier. - * - * @return {@code this}, for method chaining - */ + /// Specify the tenant identifier to be associated with the opened session. + /// + /// ```java + /// try (var session = sessionFactory.withOptions() + /// .tenantIdentifier(tenantId) + /// .openSession()) { + /// ... + /// } + /// ``` + /// @param tenantIdentifier The tenant identifier. + /// + /// @return `this`, for method chaining CommonBuilder tenantIdentifier(Object tenantIdentifier); - /** - * Specify a {@linkplain Session#isDefaultReadOnly read-only mode} - * for the session. If a session is created in read-only mode, then - * {@link Connection#setReadOnly} is called when a JDBC connection - * is obtained. - *

- * Furthermore, if read/write replication is in use, then: - *

    - *
  • a read-only session will connect to a read-only replica, but - *
  • a non-read-only session will connect to a writable replica. - *
- *

- * When read/write replication is in use, it's strongly recommended - * that the session be created with the {@linkplain #initialCacheMode - * initial cache mode} set to {@link CacheMode#GET}, to avoid writing - * stale data read from a read-only replica to the second-level cache. - * Hibernate cannot possibly guarantee that data read from a read-only - * replica is up to date. - *

- * When read/write replication is in use, it's possible that an item - * read from the second-level cache might refer to data which does not - * yet exist in the read-only replica. In this situation, an exception - * occurs when the association is fetched. To completely avoid this - * possibility, the {@linkplain #initialCacheMode initial cache mode} - * must be set to {@link CacheMode#IGNORE}. However, it's also usually - * possible to structure data access code in a way which eliminates - * this possibility. - *

- *

-	 * try (var readOnlySession =
-	 *         sessionFactory.withOptions()
-	 *                 .readOnly(true)
-	 *                 .initialCacheMode(CacheMode.IGNORE)
-	 *                 .openSession()) {
-	 *     ...
-	 * }
-	 * 
- *

- * If a session is created in read-only mode, then it cannot be - * changed to read-write mode, and any call to - * {@link Session#setDefaultReadOnly(boolean)} with fail. On the - * other hand, if a session is created in read-write mode, then it - * may later be switched to read-only mode, but all database access - * is directed to the writable replica. - * - * @return {@code this}, for method chaining - * @since 7.2 - * - * @see org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider#getReadOnlyConnection(Object) - * @see org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider#releaseReadOnlyConnection(Object, Connection) - */ + /// Specify a [read-only mode][Session#isDefaultReadOnly] + /// for the session. If a session is created in read-only mode, then + /// [Connection#setReadOnly] is called when a JDBC connection is obtained. + /// + /// Furthermore, if read/write replication is in use, then: + /// * a read-only session will connect to a read-only replica, but + /// * a non-read-only session will connect to a writable replica. + /// + /// When read/write replication is in use, it's strongly recommended + /// that the session be created with the [initial cache-mode][#initialCacheMode] + /// set to [CacheMode#GET], to avoid writing stale data read from a read-only + /// replica to the second-level cache. Hibernate cannot possibly guarantee that + /// data read from a read-only replica is up to date. + /// + /// When read/write replication is in use, it's possible that an item + /// read from the second-level cache might refer to data which does not + /// yet exist in the read-only replica. In this situation, an exception + /// occurs when the association is fetched. To completely avoid this + /// possibility, the [initial cache-mode][#initialCacheMode] must be + /// set to [CacheMode#IGNORE]. However, it's also usually possible to + /// structure data access code in a way which eliminates this possibility. + /// ```java + /// try (var readOnlySession = + /// sessionFactory.withOptions() + /// .readOnly(true) + /// .initialCacheMode(CacheMode.IGNORE) + /// .openSession()) { + /// ... + /// } + /// ``` + /// + /// If a session is created in read-only mode, then it cannot be + /// changed to read-write mode, and any call to [Session#setDefaultReadOnly(boolean)] + /// with fail. On the other hand, if a session is created in read-write mode, then it + /// may later be switched to read-only mode, but all database access is directed to + /// the writable replica. + /// + /// @return `this`, for method chaining + /// + /// @see org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider#getReadOnlyConnection(Object) + /// @see org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider#releaseReadOnlyConnection(Object, Connection) + /// + /// @since 7.2 @Incubating CommonBuilder readOnly(boolean readOnly); - /** - * Specify the initial {@link CacheMode} for the session. - * - * @return {@code this}, for method chaining - * @since 7.2 - * - * @see SharedSessionContract#getCacheMode() - */ + /// Specify the initial [CacheMode] for the session. + /// + /// @return `this`, for method chaining + /// + /// @see SharedSessionContract#getCacheMode() + /// + /// @since 7.2 CommonBuilder initialCacheMode(CacheMode cacheMode); - /** - * Specify the {@linkplain org.hibernate.cfg.JdbcSettings#JDBC_TIME_ZONE - * JDBC time zone} for the session. - * - * @return {@code this}, for method chaining - */ + /// Specify the [JDBC time zone][org.hibernate.cfg.JdbcSettings#JDBC_TIME_ZONE] + /// to use for the session. + /// + /// @return `this`, for method chaining CommonBuilder jdbcTimeZone(TimeZone timeZone); } diff --git a/hibernate-core/src/main/java/org/hibernate/engine/creation/CommonSharedBuilder.java b/hibernate-core/src/main/java/org/hibernate/engine/creation/CommonSharedBuilder.java index d375185e46a8..2d020c4a02da 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/creation/CommonSharedBuilder.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/creation/CommonSharedBuilder.java @@ -9,49 +9,36 @@ import org.hibernate.ConnectionReleaseMode; import org.hibernate.Incubating; import org.hibernate.Interceptor; -import org.hibernate.Session; -import org.hibernate.StatelessSession; import java.sql.Connection; import java.util.TimeZone; import java.util.function.UnaryOperator; -/** - * Common options for builders of {@linkplain Session stateful} - * and {@linkplain StatelessSession stateless} sessions - * which share state from an underlying session. - * - * @since 7.2 - * - * @author Steve Ebersole - */ +/// Common options for builders of [stateful][org.hibernate.Session] and +/// [stateless][org.hibernate.StatelessSession] sessions which share state +/// from an underlying stateful/stateless session. +/// +/// @since 7.2 +/// +/// @author Steve Ebersole @Incubating public interface CommonSharedBuilder extends CommonBuilder { - /** - * Signifies that the connection from the original session should be used to create the new session. - * - * @return {@code this}, for method chaining - */ + /// Signifies that the connection from the original session should be used to create the new session. + /// + /// @return `this`, for method chaining CommonSharedBuilder connection(); - /** - * Signifies the interceptor from the original session should be used to create the new session. - * - * @return {@code this}, for method chaining - */ + /// Signifies the interceptor from the original session should be used to create the new session. + /// + /// @return `this`, for method chaining CommonSharedBuilder interceptor(); - /** - * Signifies that the SQL {@linkplain org.hibernate.resource.jdbc.spi.StatementInspector statement inspector} - * from the original session should be used. - */ + /// Signifies that the SQL statement inspector from the original session should be used to create the new session. + /// + /// @return `this`, for method chaining CommonSharedBuilder statementInspector(); - /** - * Signifies that no SQL {@linkplain org.hibernate.resource.jdbc.spi.StatementInspector statement inspector} - * should be used. - */ @Override CommonSharedBuilder noStatementInspector(); diff --git a/hibernate-core/src/main/java/org/hibernate/engine/creation/internal/StatelessSessionBuilderImpl.java b/hibernate-core/src/main/java/org/hibernate/engine/creation/internal/StatelessSessionBuilderImpl.java index 38ac90bcf9ed..40fc388ebcfa 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/creation/internal/StatelessSessionBuilderImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/creation/internal/StatelessSessionBuilderImpl.java @@ -40,6 +40,11 @@ protected StatelessSessionBuilder getThis() { // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // StatelessSessionBuilder + @Override + public StatelessSession open() { + return openStatelessSession(); + } + @Override public StatelessSession openStatelessSession() { CORE_LOGGER.openingStatelessSession( tenantIdentifier );