Skip to content

Commit 5edc554

Browse files
committed
migration guide structure
1 parent 33f3032 commit 5edc554

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

migration-guide.adoc

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:versionDocBase: {docsBase}/7.0
66
:userGuideBase: {versionDocBase}/userguide/html_single/Hibernate_User_Guide.html
77
:javadocsBase: {versionDocBase}/javadocs
8-
8+
:fn-cascase-type: footnote:cascade-type[`org.hibernate.annotations.Cascade` and `org.hibernate.annotations.CascadeType` are both fully deprecated as of 7.0]
99

1010
This guide discusses migration to Hibernate ORM version 7.0. For migration from
1111
earlier versions, see any other pertinent migration guides as well.
@@ -36,6 +36,7 @@ This required a few actions on our part:
3636
* Dropping `hibernate-ucp` - see https://hibernate.atlassian.net/browse/HHH-19162
3737
* Dropping `TeradataDialect` - see https://hibernate.atlassian.net/browse/HHH-19057
3838

39+
3940
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4041
// Requirements
4142
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -55,9 +56,7 @@ This required a few actions on our part:
5556

5657
* Type parameters:
5758
** 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.
6160
* New JPA features colliding with previous Hibernate extension features:
6261
** `Nulls` (JPA) v. `NullPrecedence` (Hibernate), including JPA's new `Order#getNullPrecedence()` returning `Nulls`
6362
colliding with Hibernate's `SqmSortSpecification#getNullPrecedence` returning `NullPrecedence`. Hibernate's form
@@ -142,6 +141,7 @@ class Person {
142141

143142
This triggers Hibernate to use the column names `home_street`, `home_city`, `work_street`, ...
144143

144+
See the link:{user-guide-url}#embeddable-column-naming[User Guide] for details.
145145

146146
[[NamedEntityGraph]]
147147
=== @NamedEntityGraph
@@ -161,7 +161,7 @@ class Book {
161161

162162

163163
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.
165165

166166

167167
[[enum-checks]]
@@ -212,6 +212,8 @@ In Hibernate 7, the configuration property `hibernate.jdbc.batch_size` now has n
212212
Automatic batching may be enabled by explicitly calling `setJdbcBatchSize()`.
213213
However, the preferred approach is to explicitly batch operations via `insertMultiple()`, `updateMultiple()`, or `deleteMultiple()`.
214214

215+
216+
215217
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216218
// API changes
217219
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -224,7 +226,9 @@ A general theme in 7.0 has been to remove Hibernate-specific features that have
224226
[[session-load]]
225227
=== Session#load
226228

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.
228232

229233
[[session-refresh]]
230234
=== Session#refresh
@@ -248,13 +252,13 @@ All forms of `Session#save`, `Session#update`, `Session#saveOrUpdate` have been
248252
`Session#saveOrUpdate`::
249253
Removed in favor `#persist` if the entity is transient or `#merge` if the entity is detached
250254

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}
252256

253257

254258
[[session-delete]]
255259
=== Session#delete
256260

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}
258262

259263
[[load-fetch-graphs]]
260264
=== org.hibernate.graph Package
@@ -328,6 +332,7 @@ The effect can also often be mitigated using Hibernate's bytecode-based laziness
328332
* Removed `Session.LockRequest` - use `LockOptions` instead
329333

330334

335+
331336
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
332337
// SPI changes
333338
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -372,6 +377,7 @@ was removed in favor of `org.hibernate.metamodel.MappingMetmodel` or `org.hibern
372377
* Removed `MetadataContributor` in favor of `AdditionalMappingContributor`
373378

374379

380+
375381
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
376382
// Changes in Behavior
377383
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -462,8 +468,6 @@ To suppress the error for an auto-applied converter, use `@Convert(disableConver
462468

463469

464470

465-
466-
467471
[[create-query]]
468472
=== Query with Implicit SELECT and No Explicit Result Type
469473

0 commit comments

Comments
 (0)