You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:fn-cascase-type: footnote:cascade-type[`org.hibernate.annotations.Cascade` and `org.hibernate.annotations.CascadeType` are both fully deprecated as of 7.0]
9
9
10
10
This guide discusses migration to Hibernate ORM version 7.0. For migration from
11
11
earlier versions, see any other pertinent migration guides as well.
@@ -36,6 +36,7 @@ This required a few actions on our part:
36
36
* Dropping `hibernate-ucp` - see https://hibernate.atlassian.net/browse/HHH-19162
37
37
* Dropping `TeradataDialect` - see https://hibernate.atlassian.net/browse/HHH-19057
38
38
39
+
39
40
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
40
41
// Requirements
41
42
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -55,9 +56,7 @@ This required a few actions on our part:
55
56
56
57
* Type parameters:
57
58
** Affects much of the Criteria API - especially roots, joins, paths
58
-
** Affects much of the Graph API -
59
-
*** `org.hibernate.graph.Graph.addAttributeNode(java.lang.String)` defines a return while
60
-
`jakarta.persistence.Graph.addAttributeNode(java.lang.String)` does not.
59
+
** Affects much of the Graph API - see <<load-fetch-graphs>> for details.
61
60
* New JPA features colliding with previous Hibernate extension features:
62
61
** `Nulls` (JPA) v. `NullPrecedence` (Hibernate), including JPA's new `Order#getNullPrecedence()` returning `Nulls`
63
62
colliding with Hibernate's `SqmSortSpecification#getNullPrecedence` returning `NullPrecedence`. Hibernate's form
@@ -142,6 +141,7 @@ class Person {
142
141
143
142
This triggers Hibernate to use the column names `home_street`, `home_city`, `work_street`, ...
144
143
144
+
See the link:{user-guide-url}#embeddable-column-naming[User Guide] for details.
145
145
146
146
[[NamedEntityGraph]]
147
147
=== @NamedEntityGraph
@@ -161,7 +161,7 @@ class Book {
161
161
162
162
163
163
See `org.hibernate.graph.GraphParser` for details on the syntax and the
164
-
link:{user-guide-url}#fetching-strategies-dynamic-fetching-entity-graph-parsing-annotation[user guide] for additional details.
164
+
link:{user-guide-url}#fetching-strategies-dynamic-fetching-entity-graph-parsing-annotation[User Guide] for additional details.
165
165
166
166
167
167
[[enum-checks]]
@@ -212,6 +212,8 @@ In Hibernate 7, the configuration property `hibernate.jdbc.batch_size` now has n
212
212
Automatic batching may be enabled by explicitly calling `setJdbcBatchSize()`.
213
213
However, the preferred approach is to explicitly batch operations via `insertMultiple()`, `updateMultiple()`, or `deleteMultiple()`.
214
214
215
+
216
+
215
217
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216
218
// API changes
217
219
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -224,7 +226,9 @@ A general theme in 7.0 has been to remove Hibernate-specific features that have
224
226
[[session-load]]
225
227
=== Session#load
226
228
227
-
`Session#load` methods have been removed in favor of `Session#getReference` which has the same semantic.
229
+
`Session#load` methods have been removed in favor of `Session#getReference` which have the same semantic.
230
+
231
+
NOTE: `Session#get` was not previously deprecated as `Session#load` was, so it was not appropriate to remove. Starting in 7.0, `Session#get` is considered deprecated, to be removed in 8.0. Per the deprecation notes, use `Session#find` instead.
228
232
229
233
[[session-refresh]]
230
234
=== Session#refresh
@@ -248,13 +252,13 @@ All forms of `Session#save`, `Session#update`, `Session#saveOrUpdate` have been
248
252
`Session#saveOrUpdate`::
249
253
Removed in favor `#persist` if the entity is transient or `#merge` if the entity is detached
250
254
251
-
Relatedly, `org.hibernate.annotations.CascadeType#SAVE_UPDATE` has been removed in favor of `org.hibernate.annotations.CascadeType#PERSIST` and/or `org.hibernate.annotations.CascadeType#MERGE`
255
+
Relatedly, `org.hibernate.annotations.CascadeType#SAVE_UPDATE` has been removed in favor of `org.hibernate.annotations.CascadeType#PERSIST` and/or `org.hibernate.annotations.CascadeType#MERGE`{fn-cascase-type}
252
256
253
257
254
258
[[session-delete]]
255
259
=== Session#delete
256
260
257
-
`Session#delete` methods has been removed in favor of `Session#remove` (via `EntityManager`). Relatedly, `org.hibernate.annotations.CascadeType#DELETE` was removed in favor of `org.hibernate.annotations.CascadeType#REMOVE`
261
+
`Session#delete` methods has been removed in favor of `Session#remove`. Relatedly, `org.hibernate.annotations.CascadeType#DELETE` was removed in favor of `org.hibernate.annotations.CascadeType#REMOVE`{fn-cascase-type}
258
262
259
263
[[load-fetch-graphs]]
260
264
=== org.hibernate.graph Package
@@ -328,6 +332,7 @@ The effect can also often be mitigated using Hibernate's bytecode-based laziness
328
332
* Removed `Session.LockRequest` - use `LockOptions` instead
329
333
330
334
335
+
331
336
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
332
337
// SPI changes
333
338
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -372,6 +377,7 @@ was removed in favor of `org.hibernate.metamodel.MappingMetmodel` or `org.hibern
372
377
* Removed `MetadataContributor` in favor of `AdditionalMappingContributor`
373
378
374
379
380
+
375
381
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
376
382
// Changes in Behavior
377
383
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -462,8 +468,6 @@ To suppress the error for an auto-applied converter, use `@Convert(disableConver
462
468
463
469
464
470
465
-
466
-
467
471
[[create-query]]
468
472
=== Query with Implicit SELECT and No Explicit Result Type
0 commit comments