7.0 Beta1

This commit is contained in:
Steve Ebersole 2024-08-01 08:05:54 -05:00
parent 5f5551c950
commit e91b76aedd
2 changed files with 86 additions and 48 deletions

View File

@ -244,40 +244,72 @@ must be explicitly set to true.
[[hbm-transform]] [[hbm-transform]]
== hbm.xml Transformation == hbm.xml Transformation
Previous versions of Hibernate performed transformations of `hbm.xml` files (with `hibernate.transform_hbm_xml.enabled=true`) Hibernate's legacy `hbm.xml` mapping schema has been deprecated for quite some time, replaced by a new `mapping.xml`
one file at a time. This is now done across the entire set of `hbm.xml` files at once. schema. In 7.0, this `mapping.xml` is stabilized and we now offer a transformation of `hbm.xml` files into `mapping.xml` files.
While most users will never see this change, it might impact integrations which tie-in to
XML processing.
This tool is available as both -
* build-time transformation (currently only offered as a Gradle plugin)
* run-time transformation, using `hibernate.transform_hbm_xml.enabled=true`
Build-time transformation is preferred.
[NOTE]
====
Initial versions of the transformation processed one file at a time.
This is now done across the entire set of `hbm.xml` files at once.
While most users will never see this change, it might impact integrations which tie-in to XML processing.
====
[[cleanup]] [[cleanup]]
== Cleanup == Cleanup
* Removed `SqmQualifiedJoin`. All joins are qualified. * Annotations
* Removed `AdditionalJaxbMappingProducer`, deprecated in favor of `AdditionalMappingContributor` ** Removed `@Persister`
* Removed `MetadataContributor`, deprecated in favor of `AdditionalMappingContributor` ** Removed `@Proxy` - see <<proxy-annotation>>
* Removed `@Persister`. ** Removed `@SelectBeforeUpdate`
* Removed `hibernate.mapping.precedence` and friends ** Removed `@DynamicInsert#value` and `@DynamicUpdate#value`
* Removed `org.hibernate.Session#save` in favor of `org.hibernate.Session#persist` ** Removed `@Loader`
* Removed `org.hibernate.Session#saveOrUpdate` in favor `#persist` if the entity is transient or `#merge` if the entity is detached. ** Removed `@Table`
* Removed `org.hibernate.Session#update` in favor of `org.hibernate.Session.merge` ** Removed `@Where` and `@WhereJoinTable`
* Removed `org.hibernate.annotations.CascadeType.SAVE_UPDATE` in favor of `org.hibernate.annotations.CascadeType.PERSIST` + `org.hibernate.annotations.CascadeType.MERGE` ** Removed `@ForeignKey`
* Removed `@SelectBeforeUpdate` ** Removed `@Index`
* Removed `org.hibernate.Session#delete` in favor of `org.hibernate.Session#remove` ** Removed `@IndexColumn`
* Removed `org.hibernate.annotations.CascadeType.DELETE` in favor of `org.hibernate.annotations.CascadeType#REMOVE` ** Removed `@GeneratorType` (and `GenerationTime`, etc)
* Removed `org.hibernate.Session#refresh(String entityName, Object object)` in favor of `org.hibernate.Session#refresh(Object object)` ** Removed `@LazyToOne`
* Removed `org.hibernate.Session#refresh(String entityName, Object object, LockOptions lockOptions)` in favor of `org.hibernate.Session#refresh(Object object, LockOptions lockOptions)` ** Removed `@LazyCollection`
* Removed the attribute value from `@DynamicInsert` and `@DynamicUpdate` ** Removed `@IndexColumn`
* Removed `org.hibernate.integrator.spi.Integrator#integrate(Metadata,SessionFactoryImplementor,SessionFactoryServiceRegistry)` in favor of `org.hibernate.integrator.spi.Integrator#integrate(Metadata,BootstrapContext,SessionFactoryImplementor)` ** Replaced uses of `CacheModeType` with `CacheMode`
* 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#onFlushDirty(Object, Serializable, Object[] , Object[], String[] , Type[] )` in favour of `org.hibernate.Interceptor#onLoad(Object, Object, Object[], Object[], String[] , Type[] )` * Classes/interfaces
* Removed `org.hibernate.Interceptor#onSave(Object, Serializable, Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#onSave(Object, Object, Object[], String[], Type[])` ** Removed `SqmQualifiedJoin` (all joins are qualified)
* Removed `org.hibernate.Interceptor#onDelete(Object, Serializable, Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#onDelete(Object, Serializable, Object[], String[], Type[])` ** Removed `AdditionalJaxbMappingProducer` -> `AdditionalMappingContributor`
* Removed `org.hibernate.Interceptor#onCollectionRecreate(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionRecreate(Object, Object)` ** Removed `MetadataContributor` -> `AdditionalMappingContributor`
* Removed `org.hibernate.Interceptor#onCollectionRemove(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionRemove(Object, Object)`
* Removed `org.hibernate.Interceptor#onCollectionUpdate(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionUpdate(Object, Object)` * Behavior
* Removed `org.hibernate.Interceptor#findDirty(Object, Serializable, Object[], Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#findDirty(Object, Object, Object[], Object[], String[], Type[])` ** Removed `org.hibernate.Session#save` in favor of `org.hibernate.Session#persist`
* Removed `org.hibernate.Interceptor#getEntity(String, Serializable)` in favour of `org.hibernate.Interceptor#getEntity(String, Serializable)` ** Removed `org.hibernate.Session#saveOrUpdate` in favor `#persist` if the entity is transient or `#merge` if the entity is detached.
** Removed `org.hibernate.Session#update` in favor of `org.hibernate.Session.merge`
** Removed `org.hibernate.annotations.CascadeType.SAVE_UPDATE` in favor of `org.hibernate.annotations.CascadeType.PERSIST` + `org.hibernate.annotations.CascadeType.MERGE`
** Removed `org.hibernate.Session#delete` in favor of `org.hibernate.Session#remove`
** Removed `org.hibernate.annotations.CascadeType.DELETE` in favor of `org.hibernate.annotations.CascadeType#REMOVE`
** Removed `org.hibernate.Session#refresh(String entityName, Object object)` in favor of `org.hibernate.Session#refresh(Object object)`
** Removed `org.hibernate.Session#refresh(String entityName, Object object, LockOptions lockOptions)` in favor of `org.hibernate.Session#refresh(Object object, LockOptions lockOptions)`
** Removed `org.hibernate.integrator.spi.Integrator#integrate(Metadata,SessionFactoryImplementor,SessionFactoryServiceRegistry)` in favor of `org.hibernate.integrator.spi.Integrator#integrate(Metadata,BootstrapContext,SessionFactoryImplementor)`
** 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#onFlushDirty(Object, Serializable, Object[] , Object[], String[] , Type[] )` in favour of `org.hibernate.Interceptor#onLoad(Object, 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[])`
** Removed `org.hibernate.Interceptor#onDelete(Object, Serializable, Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#onDelete(Object, Serializable, Object[], String[], Type[])`
** Removed `org.hibernate.Interceptor#onCollectionRecreate(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionRecreate(Object, Object)`
** Removed `org.hibernate.Interceptor#onCollectionRemove(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionRemove(Object, Object)`
** Removed `org.hibernate.Interceptor#onCollectionUpdate(Object, Serializable)` in favour of `org.hibernate.Interceptor#onCollectionUpdate(Object, Object)`
** Removed `org.hibernate.Interceptor#findDirty(Object, Serializable, Object[], Object[], String[], Type[])` in favour of `org.hibernate.Interceptor#findDirty(Object, Object, Object[], Object[], String[], Type[])`
** Removed `org.hibernate.Interceptor#getEntity(String, Serializable)` in favour of `org.hibernate.Interceptor#getEntity(String, Serializable)`
* Settings
** Removed `hibernate.mapping.precedence` and friends
[[todo]] [[todo]]
== Todos (dev) == Todos (dev)

View File

@ -14,10 +14,7 @@ Steve Ebersole
:user-guide-url: {docs-url}/userguide/html_single/Hibernate_User_Guide.html :user-guide-url: {docs-url}/userguide/html_single/Hibernate_User_Guide.html
:ql-guide-url: {docs-url}/querylanguage/html_single/Hibernate_Query_Language.html :ql-guide-url: {docs-url}/querylanguage/html_single/Hibernate_Query_Language.html
With 7.0.0.Alpha2, Hibernate ORM is now passing the Jakarta Persistence 3.2 TCK!! The Hibernate ORM 7.0 Beta1 release has just been published. Here are some highlights...
- https://ci.hibernate.org/view/ORM/job/hibernate-orm-tck-3.2/job/wip%252F7.0/24/[Results] with Java 17
- https://ci.hibernate.org/view/ORM/job/hibernate-orm-tck-3.2/job/wip%252F7.0/25/[Results] with Java 21
[[jpa-32]] [[jpa-32]]
@ -27,26 +24,14 @@ With 7.0.0.Alpha2, Hibernate ORM is now passing the Jakarta Persistence 3.2 TCK!
See https://in.relation.to/2024/04/01/jakarta-persistence-3/[this blog post] for a summary of the changes in 3.2 See https://in.relation.to/2024/04/01/jakarta-persistence-3/[this blog post] for a summary of the changes in 3.2
- https://ci.hibernate.org/view/ORM/job/hibernate-orm-tck-3.2/job/wip%252F7.0/24/[TCK Results] with Java 17
- https://ci.hibernate.org/view/ORM/job/hibernate-orm-tck-3.2/job/wip%252F7.0/25/[TCK Results] with Java 21
[[java-17]] [[java-17]]
== Java 17 == Java 17
Version 3.2 of Jakarta Persistence requires Java 17. Hibernate 7.0 therefore baselines on Java 17 whereas previous versions baseline on Java 11. Version 3.2 of Jakarta Persistence requires Java 17. Hibernate 7.0 therefore baselines on Java 17 whereas previous versions baseline on Java 11.
[[mapping-xml]]
== mapping.xsd
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`
[[hibernate-models]]
== Hibernate Models
7.0 migrates from https://github.com/hibernate/hibernate-commons-annotations/[Hibernate Commons Annotations] (HCANN) to the new https://github.com/hibernate/hibernate-models[Hibernate Models] project for low-level processing of an application domain model, reading annotations and weaving in XML mapping documents.
See the link:{migration-guide-url}#hibernate-models[Migration Guide] for details.
[[model-validations]] [[model-validations]]
== Domain Model Validations == Domain Model Validations
@ -58,3 +43,24 @@ See the link:{migration-guide-url}#hibernate-models[Migration Guide] for details
See the link:{migration-guide-url}#annotation-validation[Migration Guide] for details. See the link:{migration-guide-url}#annotation-validation[Migration Guide] for details.
[[mapping-xml]]
== mapping.xsd
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`
For applications using Hibernate's legacy `hbm.xml` format, we provide a tool to help with the transformation.
See the link:{migration-guide-url}#hbm-transform[Migration Guide] for details.
[[hibernate-models]]
== Hibernate Models
7.0 migrates from https://github.com/hibernate/hibernate-commons-annotations/[Hibernate Commons Annotations] (HCANN) to the new https://github.com/hibernate/hibernate-models[Hibernate Models] project for low-level processing of an application domain model, reading annotations and weaving in XML mapping documents.
See the link:{migration-guide-url}#hibernate-models[Migration Guide] for details.
[[cleanup]]
== Clean-up
A lot of deprecated contracts and behavior has been removed. See the link:{migration-guide-url}#cleanup[Migration Guide] for details.