Skip to content

Commit f2947c3

Browse files
committed
7.1 branch
1 parent b321840 commit f2947c3

File tree

2 files changed

+9
-168
lines changed

2 files changed

+9
-168
lines changed

migration-guide.adoc

Lines changed: 4 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
= 7.1 Migration Guide
22
:toc:
33
:toclevels: 4
4-
:version: 7.1
4+
:version: 7.2
55
:docsBase: https://docs.jboss.org/hibernate/orm
66
:versionDocBase: {docsBase}/{version}
77
:userGuideBase: {versionDocBase}/userguide/html_single/Hibernate_User_Guide.html
@@ -19,7 +19,7 @@ earlier versions, see any other pertinent migration guides as well.
1919
[[requirements]]
2020
== Requirements
2121

22-
See the link:{releaseSeriesBase}[website] for the list of requirements for the 7.1 series.
22+
See the link:{releaseSeriesBase}[website] for the list of requirements for the {version} series.
2323

2424
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2525
// New Features
@@ -28,7 +28,7 @@ See the link:{releaseSeriesBase}[website] for the list of requirements for the 7
2828
[[new-features]]
2929
== New Features
3030

31-
See the link:{releaseSeriesBase}#whats-new[website] for the list of new features in the 7.1 series.
31+
See the link:{releaseSeriesBase}#whats-new[website] for the list of new features in the {version} series.
3232

3333

3434
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -40,84 +40,6 @@ See the link:{releaseSeriesBase}#whats-new[website] for the list of new features
4040

4141
This section describes changes to contracts (classes, interfaces, methods, etc.) which are considered https://hibernate.org/community/compatibility-policy/#api[API].
4242

43-
[[lock-options]]
44-
=== LockOptions
45-
46-
7.0 begins the process of reducing the visibility of `org.hibernate.LockOptions`.
47-
This class was originally exposed as an API, even though it is more properly an SPI.
48-
From an API perspective, `FindOption`, `LockOption` and `RefreshOption` are much better ways to specify this information.
49-
The class itself, as well as API methods which expose it, have been deprecated.
50-
51-
However, 2 aspects of `LockOptions` have been completely removed.
52-
First, `LockOptions` previously defined a number of constants which have been removed.
53-
Secondly, the ability to define different LockModes for individual aliases has been removed.
54-
55-
[NOTE]
56-
----
57-
ALias-specific LockModes was a very misleading feature, as Hibernate would only ever use the "greatest" LockMode.
58-
We plan to add the ability to specify a list of aliases to be locked in a later release.
59-
See https://hibernate.atlassian.net/browse/HHH-19664 for details.
60-
----
61-
62-
Application code using `org.hibernate.LockOptions` should migrate to using `FindOption`,
63-
`LockOption` and `RefreshOption` to control the various aspects of locking. E.g.
64-
65-
[source,java]
66-
----
67-
LockOptions lockOptions = new LockOptions();
68-
lockOptions.setLockMode(PESSIMISTIC_WRITE);
69-
lockOptions.setTimeout(1000);
70-
session.refresh(book, lockOptions);
71-
----
72-
73-
can instead be written as
74-
75-
[source,java]
76-
----
77-
session.refresh(book,
78-
PESSIMISTIC_WRITE,
79-
Timeout.milliseconds(1000));
80-
----
81-
82-
[[enhancement-options]]
83-
=== Bytecode Enhancement Options
84-
85-
We plan to remove two options of bytecode enhancement and have currently marked them as deprecated.
86-
87-
First is bidirectional association management.
88-
Applications should instead manage both sides of such associations directly as we have always recommended.
89-
90-
Second is a little-known feature called "extended" enhancement.
91-
Applications should instead use proper object-oriented encapsulation, exposing managed state via getters and setters.
92-
93-
Additionally, attempting to re-enhance a class with different options is no longer allowed and will result in a `FeatureMismatchException`.
94-
95-
The Gradle plugin configuration has changed slightly. When using the default setup:
96-
97-
```
98-
hibernate { enhancement }
99-
```
100-
101-
it should be updated to:
102-
103-
```
104-
hibernate {
105-
enhancement {}
106-
}
107-
```
108-
109-
in order to properly enable Bytecode Enhancement.
110-
111-
[[session-getLobHelper]]
112-
=== Session#getLobHelper
113-
114-
The `Session#getLobHelper` method has been marked as deprecated in favor of the static `Hibernate#getLobHelper` and will be removed in a future *major* version.
115-
116-
[[H2-lock-timeout]]
117-
=== WAIT, NO WAIT and SKIP LOCKED for H2
118-
119-
The for-update clause enhancements of H2 2.2.220 are now reflected in the Hibernate ORM dialect, allowing applications to use `wait`, `no wait` and `skip locked` options.
120-
12143

12244
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12345
// SPI changes
@@ -126,49 +48,7 @@ The for-update clause enhancements of H2 2.2.220 are now reflected in the Hibern
12648
[[spi-changes]]
12749
== Changes to SPI
12850

129-
[[force-increment]]
130-
=== Force-increment Locking for Version with Custom Generator
131-
132-
A new event type (`FORCE_INCREMENT`) has been added to
133-
`org.hibernate.generator.EventType` to support
134-
`OPTIMISTIC_FORCE_INCREMENT` and `PESSIMISTIC_FORCE_INCREMENT`
135-
when used with `@Version` mappings with custom generators.
136-
137-
138-
[[pessimistic-locking]]
139-
=== Pessimistic Locking
140-
141-
A number of changes have been made to pessimistic locking support.
142-
143-
* Introduction of `org.hibernate.dialect.lock.spi.LockingSupport` which represents a Dialect's support for pessimistic locking.
144-
* Introduction of `org.hibernate.sql.ast.spi.LockingClauseStrategy` to integrate into SQL AST translation.
145-
* Changed standard implementation of `org.hibernate.dialect.lock.LockingStrategy` for pessimistic locking to one using SQL AST.
146-
* Changes to `LockOptions` as <<lock-options,already discussed>>.
147-
148-
[NOTE]
149-
More changes related to pessimistic locking are coming in later 7.x releases.
150-
We've opted to tackle these in stages since they all relate and build on top of each other.
151-
See https://hibernate.atlassian.net/browse/HHH-19551 for details.
152-
153-
[[format-mapper]]
154-
=== JSON FormatMapper Enhancements
155-
156-
JSON mappings on Oracle 21+ will now try to leverage driver built-in OSON decoding to improve JSON parsing performance. In case of trouble, this can be disabled with the `hibernate.dialect.oracle.oson_format_disabled` configuration option.
157-
158-
159-
[[enhancement-option-granularity]]
160-
=== Enhancement Option Granularity
161-
162-
The actual enhancements written into bytecode were previously allowed to vary by class and sometimes even by attribute.
163-
However, all Hibernate tooling only supported setting those "globally" per enhancement.
164-
To this end, all `org.hibernate.bytecode.enhance.spi.EnhancementContext` methods which determine whether certain aspects of enhancement are applied have changed to no longer accept class/attribute.
165-
Specifically:
166-
167-
* `doDirtyCheckingInline(UnloadedClass classDescriptor)` -> `doDirtyCheckingInline()`
168-
* `doExtendedEnhancement(UnloadedClass classDescriptor)` -> `doExtendedEnhancement()`
169-
* `doBiDirectionalAssociationManagement(UnloadedField field)` -> `doBiDirectionalAssociationManagement()`
170-
171-
See also <<enhancement-options>>.
51+
This section describes changes to contracts (classes, interfaces, methods, etc.) which are considered https://hibernate.org/community/compatibility-policy/#spi[SPI].
17252

17353

17454
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -181,19 +61,9 @@ See also <<enhancement-options>>.
18161
This section describes changes to DDL generated by the schema export tooling.
18262
Such changes typically do not impact programs using a relational schema managed externally to Hibernate.
18363

184-
[[single-table-check]]
185-
=== Automatic check constraints with single table inheritance mappings
186-
187-
Previously, the non-nullability of the column mapped by an attribute declared `optional=false` by a subclass in a single table inheritance hierarchy was not enforced by the database.
188-
Hibernate now automatically generates DDL `check` constraints to enforce the non-nullability of such columns.
189-
19064

19165
[[dependency-changes]]
19266
== Changes in Dependencies
19367

19468
This section describes changes to dependencies used by Hibernate ORM.
19569

196-
[[dependency-agroal]]
197-
=== Inclusion of Agroal Pool
198-
199-
`agroal-pool` is now a transitive implementation (runtime) dependency of the `hibernate-agroal` module. Applications using `hibernate-agroal` no longer need to manually depend on it.

whats-new.adoc

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,13 @@
1-
= What's New in 7.1
1+
= What's New in 7.2
22
:toc:
33
:toclevels: 4
4+
:version: 7.2
45
:docsBase: https://docs.jboss.org/hibernate/orm
5-
:versionDocBase: {docsBase}/7.1
6+
:versionDocBase: {docsBase}/{version}
67
:userGuideBase: {versionDocBase}/userguide/html_single/Hibernate_User_Guide.html
78
:migrationGuide: {versionDocBase}/migration-guide/migration-guide.html
89

9-
Describes the new features and capabilities added to Hibernate ORM in 7.1.
10+
Describes the new features and capabilities added to Hibernate ORM in {version}.
1011

11-
If migrating from earlier versions, be sure to also check out the link:{migrationGuide}[Migration Guide] for discussion of impactful changes.
12+
IMPORTANT: If migrating from earlier versions, be sure to also check out the link:{migrationGuide}[Migration Guide] for discussion of impactful changes.
1213

13-
14-
[[resource-discovery]]
15-
== Resource Discovery in SE Environments
16-
17-
The Jakarta Persistence specification defines the ability for a provider to discover "managed resources" in EE environments, alleviating the application from manually listing all classes and XML files.
18-
However, it defines no such support in SE environments.
19-
20-
Starting with 7.1, Hibernate now supports this discovery in SE environments, by allowing applications to specify the root URL and zero-or-more "jar" URLs to search.
21-
These URLs correspond to
22-
23-
* `jakarta.persistence.spi.PersistenceUnitInfo#getPersistenceUnitRootUrl`
24-
* `jakarta.persistence.spi.PersistenceUnitInfo#getJarFileUrls`
25-
26-
These URLs are searched for managed resources according to the process defined in https://jakarta.ee/specifications/persistence/3.2/jakarta-persistence-spec-3.2#a12305[the specification].
27-
28-
[[locking]]
29-
== Locking
30-
31-
`org.hibernate.Locking` has been introduced to support various aspects of pessimistic locking:
32-
33-
* `Locking.Scope` is an extension of `jakarta.persistence.PessimisticLockScope` including some Hibernate-specific options.
34-
* `Locking.FollowOn` allows controlling Hibernate's follow-on locking behavior.
35-
36-
Additionally, we've added `org.hibernate.Timeouts` to help deal with some standard `jakarta.persistence.Timeout` values.
37-
38-
39-
[[interceptor-merge]]
40-
== Interceptor and merge
41-
42-
Support for intercepting `Session#merge` events has been added to Hibernate's `Interceptor`.

0 commit comments

Comments
 (0)