2023-01-27 04:28:55 -05:00
= 6.3 Migration Guide
2015-08-20 15:29:48 -04:00
:toc:
2022-01-05 17:24:11 -05:00
:toclevels: 4
2022-12-22 11:29:51 -05:00
:docsBase: https://docs.jboss.org/hibernate/orm
2023-01-27 04:28:55 -05:00
:versionDocBase: {docsBase}/6.3
2022-12-22 11:29:51 -05:00
:userGuideBase: {versionDocBase}/userguide/html_single/Hibernate_User_Guide.html
:javadocsBase: {versionDocBase}/javadocs
2022-01-05 17:24:11 -05:00
2023-01-27 04:28:55 -05:00
This guide discusses migration to Hibernate ORM version 6.3. For migration from
2015-08-20 15:29:48 -04:00
earlier versions, see any other pertinent migration guides as well.
2023-01-27 04:28:55 -05:00
* link:{docsBase}/6.2/migration-guide/migration-guide.html[6.2 Migration guide]
2022-12-22 11:29:51 -05:00
* link:{docsBase}/6.1/migration-guide/migration-guide.html[6.1 Migration guide]
* link:{docsBase}/6.0/migration-guide/migration-guide.html[6.0 Migration guide]
2023-08-14 12:52:42 -04:00
[[hql-numeric-literal-types]]
== HQL Numeric Literal Types
Version 3.2 of the Jakarta Persistence specification
https://github.com/jakartaee/persistence/issues/423[clarifies] the interpretation of
numeric literals with regard to type, explicitly aligning with the Java specification (as well
as adopting Hibernate's long-standing `BigInteger` and `BigDecimal` suffixes).
HQL and JPQL are domain/object-level queries, so that makes perfect sense.
* `Integer` - 123
* `Long` - 123l, 123L
* `BigInteger` - 123bi, 123BI
* `Double` - 123.4
* `Float` - 123.4f, 123.4F
* `BigDecimal` - 123.4bd, 123.4BD
Hibernate 6.3 aligns with those interpretations, which may lead to different behavior
from prior versions.
2023-06-22 06:00:09 -04:00
[[batch-fetching-changes]]
== Batch Fetching and LockMode
When LockMode is greater than READ Hibernate does not execute the batch fetching so existing uninitialized proxies will not be initialized.
This because the lock mode is different from the one of the proxies in the batch fetch queue.
E.g.
2023-08-14 12:52:42 -04:00
```java
2023-06-22 06:00:09 -04:00
MyEntity proxy = session.getReference( MyEntity.class, 1 );
MyEntity myEntity = session.find(MyEntity.class, 2, LockMode.WRITE);
2023-08-14 12:52:42 -04:00
```
2023-06-22 06:00:09 -04:00
only the entity with id equals to 2 will be loaded but the proxy will not be initialized.
2023-09-28 16:50:51 -04:00
[[metamodel-generation]]
== Integrating Static Metamodel Generation
The integration of static metamodel generation in a project has changed; the recommended way to do this now is by harnessing the annotation processor classpath. This is true for both gradle and maven.
Check out the specific sections in the User Guide for a guideline on how to do this for {userGuideBase}#tooling-gradle-modelgen[Gradle] or {userGuideBase}#tooling-maven-modelgen[Maven].