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
Copy file name to clipboardExpand all lines: migration-guide.adoc
+61-29Lines changed: 61 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -244,40 +244,72 @@ must be explicitly set to true.
244
244
[[hbm-transform]]
245
245
== hbm.xml Transformation
246
246
247
-
Previous versions of Hibernate performed transformations of `hbm.xml` files (with `hibernate.transform_hbm_xml.enabled=true`)
248
-
one file at a time. This is now done across the entire set of `hbm.xml` files at once.
249
-
While most users will never see this change, it might impact integrations which tie-in to
250
-
XML processing.
247
+
Hibernate's legacy `hbm.xml` mapping schema has been deprecated for quite some time, replaced by a new `mapping.xml`
248
+
schema. In 7.0, this `mapping.xml` is stabilized and we now offer a transformation of `hbm.xml` files into `mapping.xml` files.
251
249
250
+
This tool is available as both -
251
+
252
+
* build-time transformation (currently only offered as a Gradle plugin)
253
+
* run-time transformation, using `hibernate.transform_hbm_xml.enabled=true`
254
+
255
+
Build-time transformation is preferred.
256
+
257
+
[NOTE]
258
+
====
259
+
Initial versions of the transformation processed one file at a time.
260
+
This is now done across the entire set of `hbm.xml` files at once.
261
+
While most users will never see this change, it might impact integrations which tie-in to XML processing.
262
+
====
252
263
253
264
[[cleanup]]
254
265
== Cleanup
255
266
256
-
* Removed `SqmQualifiedJoin`. All joins are qualified.
257
-
* Removed `AdditionalJaxbMappingProducer`, deprecated in favor of `AdditionalMappingContributor`
258
-
* Removed `MetadataContributor`, deprecated in favor of `AdditionalMappingContributor`
259
-
* Removed `@Persister`.
260
-
* Removed `hibernate.mapping.precedence` and friends
261
-
* Removed `org.hibernate.Session#save` in favor of `org.hibernate.Session#persist`
262
-
* Removed `org.hibernate.Session#saveOrUpdate` in favor `#persist` if the entity is transient or `#merge` if the entity is detached.
263
-
* Removed `org.hibernate.Session#update` in favor of `org.hibernate.Session.merge`
264
-
* Removed `org.hibernate.annotations.CascadeType.SAVE_UPDATE` in favor of `org.hibernate.annotations.CascadeType.PERSIST` + `org.hibernate.annotations.CascadeType.MERGE`
265
-
* Removed `@SelectBeforeUpdate`
266
-
* Removed `org.hibernate.Session#delete` in favor of `org.hibernate.Session#remove`
267
-
* Removed `org.hibernate.annotations.CascadeType.DELETE` in favor of `org.hibernate.annotations.CascadeType#REMOVE`
268
-
* Removed `org.hibernate.Session#refresh(String entityName, Object object)` in favor of `org.hibernate.Session#refresh(Object object)`
269
-
* Removed `org.hibernate.Session#refresh(String entityName, Object object, LockOptions lockOptions)` in favor of `org.hibernate.Session#refresh(Object object, LockOptions lockOptions)`
270
-
* Removed the attribute value from `@DynamicInsert` and `@DynamicUpdate`
271
-
* Removed `org.hibernate.integrator.spi.Integrator#integrate(Metadata,SessionFactoryImplementor,SessionFactoryServiceRegistry)` in favor of `org.hibernate.integrator.spi.Integrator#integrate(Metadata,BootstrapContext,SessionFactoryImplementor)`
272
-
* Removed `org.hibernate.Interceptor#onLoad(Object, Serializable, Object[] , String[] , Type[] )` in favour of `org.hibernate.Interceptor#onLoad(Object, Object, Object[], String[], Type[] )`
* Removed `org.hibernate.Interceptor#onSave(Object, Serializable, Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#onSave(Object, Object, Object[], String[], Type[])`
275
-
* Removed `org.hibernate.Interceptor#onDelete(Object, Serializable, Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#onDelete(Object, Serializable, Object[], String[], Type[])`
276
-
* Removed `org.hibernate.Interceptor#onCollectionRecreate(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionRecreate(Object, Object)`
277
-
* Removed `org.hibernate.Interceptor#onCollectionRemove(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionRemove(Object, Object)`
278
-
* Removed `org.hibernate.Interceptor#onCollectionUpdate(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionUpdate(Object, Object)`
279
-
* Removed `org.hibernate.Interceptor#findDirty(Object, Serializable, Object[], Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#findDirty(Object, Object, Object[], Object[], String[], Type[])`
280
-
* Removed `org.hibernate.Interceptor#getEntity(String, Serializable)` in favour of `org.hibernate.Interceptor#getEntity(String, Serializable)`
267
+
* Annotations
268
+
** Removed `@Persister`
269
+
** Removed `@Proxy` - see <<proxy-annotation>>
270
+
** Removed `@SelectBeforeUpdate`
271
+
** Removed `@DynamicInsert#value` and `@DynamicUpdate#value`
** Removed `org.hibernate.Session#save` in favor of `org.hibernate.Session#persist`
291
+
** Removed `org.hibernate.Session#saveOrUpdate` in favor `#persist` if the entity is transient or `#merge` if the entity is detached.
292
+
** Removed `org.hibernate.Session#update` in favor of `org.hibernate.Session.merge`
293
+
** Removed `org.hibernate.annotations.CascadeType.SAVE_UPDATE` in favor of `org.hibernate.annotations.CascadeType.PERSIST` + `org.hibernate.annotations.CascadeType.MERGE`
294
+
** Removed `org.hibernate.Session#delete` in favor of `org.hibernate.Session#remove`
295
+
** Removed `org.hibernate.annotations.CascadeType.DELETE` in favor of `org.hibernate.annotations.CascadeType#REMOVE`
296
+
** Removed `org.hibernate.Session#refresh(String entityName, Object object)` in favor of `org.hibernate.Session#refresh(Object object)`
297
+
** Removed `org.hibernate.Session#refresh(String entityName, Object object, LockOptions lockOptions)` in favor of `org.hibernate.Session#refresh(Object object, LockOptions lockOptions)`
298
+
** Removed `org.hibernate.integrator.spi.Integrator#integrate(Metadata,SessionFactoryImplementor,SessionFactoryServiceRegistry)` in favor of `org.hibernate.integrator.spi.Integrator#integrate(Metadata,BootstrapContext,SessionFactoryImplementor)`
299
+
** Removed `org.hibernate.Interceptor#onLoad(Object, Serializable, Object[] , String[] , Type[] )` in favour of `org.hibernate.Interceptor#onLoad(Object, Object, Object[], String[], Type[] )`
** Removed `org.hibernate.Interceptor#onSave(Object, Serializable, Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#onSave(Object, Object, Object[], String[], Type[])`
302
+
** Removed `org.hibernate.Interceptor#onDelete(Object, Serializable, Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#onDelete(Object, Serializable, Object[], String[], Type[])`
303
+
** Removed `org.hibernate.Interceptor#onCollectionRecreate(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionRecreate(Object, Object)`
304
+
** Removed `org.hibernate.Interceptor#onCollectionRemove(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionRemove(Object, Object)`
305
+
** Removed `org.hibernate.Interceptor#onCollectionUpdate(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionUpdate(Object, Object)`
306
+
** Removed `org.hibernate.Interceptor#findDirty(Object, Serializable, Object[], Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#findDirty(Object, Object, Object[], Object[], String[], Type[])`
307
+
** Removed `org.hibernate.Interceptor#getEntity(String, Serializable)` in favour of `org.hibernate.Interceptor#getEntity(String, Serializable)`
308
+
309
+
* Settings
310
+
** Removed `hibernate.mapping.precedence` and friends
With 7.0.0.Alpha2, Hibernate ORM is now passing the Jakarta Persistence 3.2 TCK!!
18
-
19
-
- https://ci.hibernate.org/view/ORM/job/hibernate-orm-tck-3.2/job/wip%252F7.0/24/[Results] with Java 17
20
-
- https://ci.hibernate.org/view/ORM/job/hibernate-orm-tck-3.2/job/wip%252F7.0/25/[Results] with Java 21
17
+
The Hibernate ORM 7.0 Beta1 release has just been published. Here are some highlights...
21
18
22
19
23
20
[[jpa-32]]
@@ -27,17 +24,33 @@ With 7.0.0.Alpha2, Hibernate ORM is now passing the Jakarta Persistence 3.2 TCK!
27
24
28
25
See https://in.relation.to/2024/04/01/jakarta-persistence-3/[this blog post] for a summary of the changes in 3.2
29
26
27
+
- https://ci.hibernate.org/view/ORM/job/hibernate-orm-tck-3.2/job/wip%252F7.0/24/[TCK Results] with Java 17
28
+
- https://ci.hibernate.org/view/ORM/job/hibernate-orm-tck-3.2/job/wip%252F7.0/25/[TCK Results] with Java 21
29
+
30
30
[[java-17]]
31
31
== Java 17
32
32
33
33
Version 3.2 of Jakarta Persistence requires Java 17. Hibernate 7.0 therefore baselines on Java 17 whereas previous versions baseline on Java 11.
34
34
35
+
[[model-validations]]
36
+
== Domain Model Validations
37
+
38
+
7.0 does much more validation of an application's domain model and especially its mapping details, e.g.
39
+
40
+
* illegal combinations such as `@Basic` and `@ManyToOne` on the same attribute
41
+
* misplaced annotations such as an annotated getter method with FIELD access
42
+
* stricter following of JavaBean conventions
43
+
44
+
See the link:{migration-guide-url}#annotation-validation[Migration Guide] for details.
35
45
36
46
[[mapping-xml]]
37
47
== mapping.xsd
38
48
39
49
Hibernate 7.0 provides a new XSD that represents an "extension" of the Jakarta Persistence orm.xsd weaving in Hibernate-specific mapping features. The namespace for this extended mapping is `http://www.hibernate.org/xsd/orm/mapping`
40
50
51
+
For applications using Hibernate's legacy `hbm.xml` format, we provide a tool to help with the transformation.
52
+
See the link:{migration-guide-url}#hbm-transform[Migration Guide] for details.
53
+
41
54
42
55
[[hibernate-models]]
43
56
== Hibernate Models
@@ -47,14 +60,7 @@ Hibernate 7.0 provides a new XSD that represents an "extension" of the Jakarta P
47
60
See the link:{migration-guide-url}#hibernate-models[Migration Guide] for details.
48
61
49
62
50
-
[[model-validations]]
51
-
== Domain Model Validations
52
-
53
-
7.0 does much more validation of an application's domain model and especially its mapping details, e.g.
54
-
55
-
* illegal combinations such as `@Basic` and `@ManyToOne` on the same attribute
56
-
* misplaced annotations such as an annotated getter method with FIELD access
57
-
* stricter following of JavaBean conventions
58
-
59
-
See the link:{migration-guide-url}#annotation-validation[Migration Guide] for details.
63
+
[[cleanup]]
64
+
== Clean-up
60
65
66
+
A lot of deprecated contracts and behavior has been removed. See the link:{migration-guide-url}#cleanup[Migration Guide] for details.
0 commit comments