diff --git a/migration-guide.adoc b/migration-guide.adoc index efbb222e10..4ff4e2acc5 100644 --- a/migration-guide.adoc +++ b/migration-guide.adoc @@ -244,40 +244,72 @@ must be explicitly set to true. [[hbm-transform]] == hbm.xml Transformation -Previous versions of Hibernate performed transformations of `hbm.xml` files (with `hibernate.transform_hbm_xml.enabled=true`) -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. +Hibernate's legacy `hbm.xml` mapping schema has been deprecated for quite some time, replaced by a new `mapping.xml` +schema. In 7.0, this `mapping.xml` is stabilized and we now offer a transformation of `hbm.xml` files into `mapping.xml` files. +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 -* Removed `SqmQualifiedJoin`. All joins are qualified. -* Removed `AdditionalJaxbMappingProducer`, deprecated in favor of `AdditionalMappingContributor` -* Removed `MetadataContributor`, deprecated in favor of `AdditionalMappingContributor` -* Removed `@Persister`. -* Removed `hibernate.mapping.precedence` and friends -* Removed `org.hibernate.Session#save` in favor of `org.hibernate.Session#persist` -* 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 `@SelectBeforeUpdate` -* 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 the attribute value from `@DynamicInsert` and `@DynamicUpdate` -* 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)` +* Annotations +** Removed `@Persister` +** Removed `@Proxy` - see <> +** Removed `@SelectBeforeUpdate` +** Removed `@DynamicInsert#value` and `@DynamicUpdate#value` +** Removed `@Loader` +** Removed `@Table` +** Removed `@Where` and `@WhereJoinTable` +** Removed `@ForeignKey` +** Removed `@Index` +** Removed `@IndexColumn` +** Removed `@GeneratorType` (and `GenerationTime`, etc) +** Removed `@LazyToOne` +** Removed `@LazyCollection` +** Removed `@IndexColumn` +** Replaced uses of `CacheModeType` with `CacheMode` + +* Classes/interfaces +** Removed `SqmQualifiedJoin` (all joins are qualified) +** Removed `AdditionalJaxbMappingProducer` -> `AdditionalMappingContributor` +** Removed `MetadataContributor` -> `AdditionalMappingContributor` + +* Behavior +** Removed `org.hibernate.Session#save` in favor of `org.hibernate.Session#persist` +** 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]] == Todos (dev) diff --git a/release-announcement.adoc b/release-announcement.adoc index a0c07caa49..28ef57ba80 100644 --- a/release-announcement.adoc +++ b/release-announcement.adoc @@ -14,10 +14,7 @@ Steve Ebersole :user-guide-url: {docs-url}/userguide/html_single/Hibernate_User_Guide.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!! - -- 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 +The Hibernate ORM 7.0 Beta1 release has just been published. Here are some highlights... [[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 +- 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 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]] == 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. +[[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. \ No newline at end of file