Skip to content

Commit 0bee654

Browse files
committed
Document actual status of orm.hibernate5 and Hibernate JPA support
See gh-35111
1 parent f84552a commit 0bee654

File tree

6 files changed

+12
-24
lines changed

6 files changed

+12
-24
lines changed

framework-docs/modules/ROOT/pages/data-access/orm/hibernate.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ As of Spring Framework 6.0, Spring requires Hibernate ORM 5.5+ for Spring's
1414
`HibernateJpaVendorAdapter` as well as for a native Hibernate `SessionFactory` setup.
1515
We recommend Hibernate ORM 5.6 as the last feature branch in that Hibernate generation.
1616
17-
Hibernate ORM 6.x is only supported as a JPA provider (`HibernateJpaVendorAdapter`).
18-
Plain `SessionFactory` setup with the `orm.hibernate5` package is not supported anymore.
19-
We recommend Hibernate ORM 6.1/6.2 with JPA-style setup for new development projects.
17+
Hibernate ORM 6.x is primarily supported as a JPA provider (`HibernateJpaVendorAdapter`).
18+
Plain `SessionFactory` setup with the `orm.hibernate5` package is tolerated for migration
19+
purposes. We recommend Hibernate ORM 6.x with JPA-style setup for new development projects.
2020
====
2121

2222

spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateTransactionManager.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,6 @@
9797
* support nested transactions! Hence, do not expect Hibernate access code to
9898
* semantically participate in a nested transaction.</i>
9999
*
100-
* <p><b>NOTE: Hibernate ORM 6.x is officially only supported as a JPA provider.
101-
* Please use {@link org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean}
102-
* with {@link org.springframework.orm.jpa.JpaTransactionManager} there instead.</b>
103-
*
104100
* @author Juergen Hoeller
105101
* @since 4.2
106102
* @see #setSessionFactory
@@ -285,10 +281,9 @@ public void setAllowResultAccessAfterCompletion(boolean allowResultAccessAfterCo
285281
/**
286282
* Set whether to operate on a Hibernate-managed Session instead of a
287283
* Spring-managed Session, that is, whether to obtain the Session through
288-
* Hibernate's {@link SessionFactory#getCurrentSession()}
289-
* instead of {@link SessionFactory#openSession()} (with a Spring
290-
* {@link TransactionSynchronizationManager}
291-
* check preceding it).
284+
* Hibernate's {@link SessionFactory#getCurrentSession()} instead of
285+
* {@link SessionFactory#openSession()} (with a Spring
286+
* {@link TransactionSynchronizationManager} check preceding it).
292287
* <p>Default is "false", i.e. using a Spring-managed Session: taking the current
293288
* thread-bound Session if available (for example, in an Open-Session-in-View scenario),
294289
* creating a new Session for the current transaction otherwise.

spring-orm/src/main/java/org/springframework/orm/hibernate5/LocalSessionFactoryBean.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,6 @@
6868
* {@link HibernateTransactionManager}, this naturally allows for mixing JPA access code
6969
* with native Hibernate access code within the same transaction.
7070
*
71-
* <p><b>NOTE: Hibernate ORM 6.x is officially only supported as a JPA provider.
72-
* Please use {@link org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean}
73-
* with {@link org.springframework.orm.jpa.JpaTransactionManager} there instead.</b>
74-
*
7571
* @author Juergen Hoeller
7672
* @since 4.2
7773
* @see #setDataSource

spring-orm/src/main/java/org/springframework/orm/hibernate5/package-info.java

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

spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaDialect.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
/**
7777
* {@link org.springframework.orm.jpa.JpaDialect} implementation for Hibernate.
78-
* Compatible with Hibernate ORM 5.5/5.6 as well as 6.0/6.1/6.2/6.3.
78+
* Compatible with Hibernate ORM 5.5/5.6 as well as 6.x.
7979
*
8080
* @author Juergen Hoeller
8181
* @author Costin Leau

spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaVendorAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
/**
4949
* {@link org.springframework.orm.jpa.JpaVendorAdapter} implementation for Hibernate.
50-
* Compatible with Hibernate ORM 5.5/5.6 as well as 6.0/6.1/6.2/6.3.
50+
* Compatible with Hibernate ORM 5.5/5.6 as well as 6.x.
5151
*
5252
* <p>Exposes Hibernate's persistence provider and Hibernate's Session as extended
5353
* EntityManager interface, and adapts {@link AbstractJpaVendorAdapter}'s common

0 commit comments

Comments
 (0)