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
@@ -19,7 +19,7 @@ earlier versions, see any other pertinent migration guides as well.
19
19
[[requirements]]
20
20
== Requirements
21
21
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.
23
23
24
24
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
25
25
// New Features
@@ -28,7 +28,7 @@ See the link:{releaseSeriesBase}[website] for the list of requirements for the 7
28
28
[[new-features]]
29
29
== New Features
30
30
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.
32
32
33
33
34
34
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -40,84 +40,6 @@ See the link:{releaseSeriesBase}#whats-new[website] for the list of new features
40
40
41
41
This section describes changes to contracts (classes, interfaces, methods, etc.) which are considered https://hibernate.org/community/compatibility-policy/#api[API].
42
42
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
-
121
43
122
44
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123
45
// SPI changes
@@ -126,49 +48,7 @@ The for-update clause enhancements of H2 2.2.220 are now reflected in the Hibern
126
48
[[spi-changes]]
127
49
== Changes to SPI
128
50
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.
This section describes changes to contracts (classes, interfaces, methods, etc.) which are considered https://hibernate.org/community/compatibility-policy/#spi[SPI].
172
52
173
53
174
54
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -181,19 +61,9 @@ See also <<enhancement-options>>.
181
61
This section describes changes to DDL generated by the schema export tooling.
182
62
Such changes typically do not impact programs using a relational schema managed externally to Hibernate.
183
63
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
-
190
64
191
65
[[dependency-changes]]
192
66
== Changes in Dependencies
193
67
194
68
This section describes changes to dependencies used by Hibernate ORM.
195
69
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.
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}.
10
11
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.
12
13
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.
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.
0 commit comments