Skip to content

Commit d47f1a1

Browse files
committed
Migrate orm.hibernate5 to orm.jpa.hibernate package for Hibernate ORM 7.0
Closes gh-35111
1 parent f3f05da commit d47f1a1

34 files changed

+401
-1648
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[[orm-hibernate]]
22
= Hibernate
33

4-
We start with a coverage of https://hibernate.org/[Hibernate 5] in a Spring environment,
4+
We start with a coverage of https://hibernate.org/[Hibernate] in a Spring environment,
55
using it to demonstrate the approach that Spring takes towards integrating OR mappers.
66
This section covers many issues in detail and shows different variations of DAO
77
implementations and transaction demarcation. Most of these patterns can be directly
@@ -10,13 +10,12 @@ cover the other ORM technologies and show brief examples.
1010

1111
[NOTE]
1212
====
13-
As of Spring Framework 6.0, Spring requires Hibernate ORM 5.5+ for Spring's
13+
As of Spring Framework 7.0, Spring requires Hibernate ORM 7.0 for Spring's
1414
`HibernateJpaVendorAdapter` as well as for a native Hibernate `SessionFactory` setup.
15-
We recommend Hibernate ORM 5.6 as the last feature branch in that Hibernate generation.
1615
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.
16+
The `org.springframework.orm.jpa.hibernate` package supersedes the former `orm.hibernate5`:
17+
now for use with Hibernate ORM 7.0, tightly integrated with `HibernateJpaVendorAdapter`
18+
as well as supporting Hibernate's native `SessionFactory.getCurrentSession()` style.
2019
====
2120

2221

@@ -43,7 +42,7 @@ JDBC `DataSource` and a Hibernate `SessionFactory` on top of it:
4342
<property name="password" value=""/>
4443
</bean>
4544
46-
<bean id="mySessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
45+
<bean id="mySessionFactory" class="org.springframework.orm.jpa.hibernate.LocalSessionFactoryBean">
4746
<property name="dataSource" ref="myDataSource"/>
4847
<property name="mappingResources">
4948
<list>
@@ -271,7 +270,7 @@ processing at runtime. The following example shows how to do so:
271270
<!-- SessionFactory, DataSource, etc. omitted -->
272271
273272
<bean id="transactionManager"
274-
class="org.springframework.orm.hibernate5.HibernateTransactionManager">
273+
class="org.springframework.orm.jpa.hibernate.HibernateTransactionManager">
275274
<property name="sessionFactory" ref="sessionFactory"/>
276275
</bean>
277276
@@ -301,7 +300,7 @@ and an example for a business method implementation:
301300
----
302301
<beans>
303302
304-
<bean id="myTxManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
303+
<bean id="myTxManager" class="org.springframework.orm.jpa.hibernate.HibernateTransactionManager">
305304
<property name="sessionFactory" ref="mySessionFactory"/>
306305
</bean>
307306

framework-docs/modules/ROOT/pages/data-access/transaction/strategies.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ example declares `sessionFactory` and `txManager` beans:
212212

213213
[source,xml,indent=0,subs="verbatim,quotes"]
214214
----
215-
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
215+
<bean id="sessionFactory" class="org.springframework.orm.jpa.hibernate.LocalSessionFactoryBean">
216216
<property name="dataSource" ref="dataSource"/>
217217
<property name="mappingResources">
218218
<list>
@@ -226,7 +226,7 @@ example declares `sessionFactory` and `txManager` beans:
226226
</property>
227227
</bean>
228228
229-
<bean id="txManager" class="org.springframework.orm.hibernate5.HibernateTransactionManager">
229+
<bean id="txManager" class="org.springframework.orm.jpa.hibernate.HibernateTransactionManager">
230230
<property name="sessionFactory" ref="sessionFactory"/>
231231
</bean>
232232
----
@@ -238,7 +238,7 @@ transaction coordinator and possibly also its connection release mode configurat
238238

239239
[source,xml,indent=0,subs="verbatim,quotes"]
240240
----
241-
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
241+
<bean id="sessionFactory" class="org.springframework.orm.jpa.hibernate.LocalSessionFactoryBean">
242242
<property name="dataSource" ref="dataSource"/>
243243
<property name="mappingResources">
244244
<list>
@@ -262,7 +262,7 @@ for enforcing the same defaults:
262262

263263
[source,xml,indent=0,subs="verbatim,quotes"]
264264
----
265-
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
265+
<bean id="sessionFactory" class="org.springframework.orm.jpa.hibernate.LocalSessionFactoryBean">
266266
<property name="dataSource" ref="dataSource"/>
267267
<property name="mappingResources">
268268
<list>

framework-docs/modules/ROOT/pages/testing/testcontext-framework/fixture-di.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ shows this configuration:
172172
<property name="sessionFactory" ref="sessionFactory"/>
173173
</bean>
174174
175-
<bean id="sessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
175+
<bean id="sessionFactory" class="org.springframework.orm.jpa.hibernate.LocalSessionFactoryBean">
176176
<!-- configuration elided for brevity -->
177177
</bean>
178178

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

Lines changed: 0 additions & 101 deletions
This file was deleted.

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

Lines changed: 0 additions & 58 deletions
This file was deleted.

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

Lines changed: 0 additions & 43 deletions
This file was deleted.

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

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)