Document actual status of orm.hibernate5 and Hibernate JPA support

See gh-35111
This commit is contained in:
Juergen Hoeller 2025-06-25 18:59:06 +02:00
parent f84552a97e
commit 0bee65482f
6 changed files with 12 additions and 24 deletions

View File

@ -14,9 +14,9 @@ As of Spring Framework 6.0, Spring requires Hibernate ORM 5.5+ for Spring's
`HibernateJpaVendorAdapter` as well as for a native Hibernate `SessionFactory` setup. `HibernateJpaVendorAdapter` as well as for a native Hibernate `SessionFactory` setup.
We recommend Hibernate ORM 5.6 as the last feature branch in that Hibernate generation. We recommend Hibernate ORM 5.6 as the last feature branch in that Hibernate generation.
Hibernate ORM 6.x is only supported as a JPA provider (`HibernateJpaVendorAdapter`). Hibernate ORM 6.x is primarily supported as a JPA provider (`HibernateJpaVendorAdapter`).
Plain `SessionFactory` setup with the `orm.hibernate5` package is not supported anymore. Plain `SessionFactory` setup with the `orm.hibernate5` package is tolerated for migration
We recommend Hibernate ORM 6.1/6.2 with JPA-style setup for new development projects. purposes. We recommend Hibernate ORM 6.x with JPA-style setup for new development projects.
==== ====

View File

@ -97,10 +97,6 @@ import org.springframework.util.Assert;
* support nested transactions! Hence, do not expect Hibernate access code to * support nested transactions! Hence, do not expect Hibernate access code to
* semantically participate in a nested transaction.</i> * semantically participate in a nested transaction.</i>
* *
* <p><b>NOTE: Hibernate ORM 6.x is officially only supported as a JPA provider.
* Please use {@link org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean}
* with {@link org.springframework.orm.jpa.JpaTransactionManager} there instead.</b>
*
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 4.2 * @since 4.2
* @see #setSessionFactory * @see #setSessionFactory
@ -285,10 +281,9 @@ public class HibernateTransactionManager extends AbstractPlatformTransactionMana
/** /**
* Set whether to operate on a Hibernate-managed Session instead of a * Set whether to operate on a Hibernate-managed Session instead of a
* Spring-managed Session, that is, whether to obtain the Session through * Spring-managed Session, that is, whether to obtain the Session through
* Hibernate's {@link SessionFactory#getCurrentSession()} * Hibernate's {@link SessionFactory#getCurrentSession()} instead of
* instead of {@link SessionFactory#openSession()} (with a Spring * {@link SessionFactory#openSession()} (with a Spring
* {@link TransactionSynchronizationManager} * {@link TransactionSynchronizationManager} check preceding it).
* check preceding it).
* <p>Default is "false", i.e. using a Spring-managed Session: taking the current * <p>Default is "false", i.e. using a Spring-managed Session: taking the current
* thread-bound Session if available (for example, in an Open-Session-in-View scenario), * thread-bound Session if available (for example, in an Open-Session-in-View scenario),
* creating a new Session for the current transaction otherwise. * creating a new Session for the current transaction otherwise.

View File

@ -68,10 +68,6 @@ import org.springframework.lang.Nullable;
* {@link HibernateTransactionManager}, this naturally allows for mixing JPA access code * {@link HibernateTransactionManager}, this naturally allows for mixing JPA access code
* with native Hibernate access code within the same transaction. * with native Hibernate access code within the same transaction.
* *
* <p><b>NOTE: Hibernate ORM 6.x is officially only supported as a JPA provider.
* Please use {@link org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean}
* with {@link org.springframework.orm.jpa.JpaTransactionManager} there instead.</b>
*
* @author Juergen Hoeller * @author Juergen Hoeller
* @since 4.2 * @since 4.2
* @see #setDataSource * @see #setDataSource

View File

@ -1,14 +1,11 @@
/** /**
* Package providing integration of * Package providing integration of
* <a href="https://hibernate.org/">Hibernate 5.x</a> * <a href="https://hibernate.org/">Hibernate ORM 5.x</a>
* with Spring concepts. * with Spring concepts.
* *
* <p>Contains an implementation of Spring's transaction SPI for local Hibernate transactions. * <p>This package supports Hibernate 5.x while also tolerating use against
* This package is intentionally rather minimal, with no template classes or the like, * Hibernate ORM 6.x for migration purposes. Note that we strongly recommend
* in order to follow Hibernate recommendations as closely as possible. We recommend * Hibernate's native <code>sessionFactory.getCurrentSession()</code> style.
* using Hibernate's native <code>sessionFactory.getCurrentSession()</code> style.
*
* <p><b>This package supports Hibernate 5.x only.</b>
*/ */
@NonNullApi @NonNullApi
@NonNullFields @NonNullFields

View File

@ -75,7 +75,7 @@ import org.springframework.util.ReflectionUtils;
/** /**
* {@link org.springframework.orm.jpa.JpaDialect} implementation for Hibernate. * {@link org.springframework.orm.jpa.JpaDialect} implementation for Hibernate.
* Compatible with Hibernate ORM 5.5/5.6 as well as 6.0/6.1/6.2/6.3. * Compatible with Hibernate ORM 5.5/5.6 as well as 6.x.
* *
* @author Juergen Hoeller * @author Juergen Hoeller
* @author Costin Leau * @author Costin Leau

View File

@ -47,7 +47,7 @@ import org.springframework.util.ClassUtils;
/** /**
* {@link org.springframework.orm.jpa.JpaVendorAdapter} implementation for Hibernate. * {@link org.springframework.orm.jpa.JpaVendorAdapter} implementation for Hibernate.
* Compatible with Hibernate ORM 5.5/5.6 as well as 6.0/6.1/6.2/6.3. * Compatible with Hibernate ORM 5.5/5.6 as well as 6.x.
* *
* <p>Exposes Hibernate's persistence provider and Hibernate's Session as extended * <p>Exposes Hibernate's persistence provider and Hibernate's Session as extended
* EntityManager interface, and adapts {@link AbstractJpaVendorAdapter}'s common * EntityManager interface, and adapts {@link AbstractJpaVendorAdapter}'s common