Skip to content

Commit 6cecc13

Browse files
committed
Create 7.2 branch
1 parent f24de36 commit 6cecc13

File tree

2 files changed

+3
-284
lines changed

2 files changed

+3
-284
lines changed

migration-guide.adoc

Lines changed: 2 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
:toc2:
33
:sectanchors:
44
:toclevels: 4
5-
:version: 7.2
5+
:version: 7.3
66
:docsBase: https://docs.jboss.org/hibernate/orm
77
:versionDocBase: {docsBase}/{version}
88
:userGuideBase: {versionDocBase}/userguide/html_single/Hibernate_User_Guide.html
@@ -22,11 +22,6 @@ earlier versions, see any other pertinent migration guides as well.
2222

2323
See the link:{releaseSeriesBase}[website] for the list of requirements for the {version} series.
2424

25-
[[requirements-building]]
26-
=== Building
27-
28-
Starting with version 7.2, Gradle 9 and Java 25 are required to build the project.
29-
However, the produced artifacts are still compatible with Java 17 and the produced Gradle plugin is still compatible with Gradle 8.
3025

3126

3227
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -48,50 +43,6 @@ See the link:{releaseSeriesBase}#whats-new[website] for the list of new features
4843

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

51-
[[contains]]
52-
=== Session.contains(String,Object) deprecated
53-
54-
The method `contains(String,Object)` of `Session` was deprecated.
55-
Use `contains(Object)` instead.
56-
57-
[[noInterceptor]]
58-
== SharedSessionBuilder.noInterceptor()
59-
60-
The behavior of `SharedSessionBuilder.noInterceptor()` was changed to reflect its documented semantics.
61-
62-
[[jpa]]
63-
=== @Jpa (hibernate-testing)
64-
65-
The following methods have been removed from the `@Jpa` test utility, located in the hibernate-testing project:
66-
67-
- `jpaComplianceEnabled()`
68-
- `queryComplianceEnabled()`
69-
- `transactionComplianceEnabled()`
70-
- `closedComplianceEnabled()`
71-
- `orderByMappingComplianceEnabled()`
72-
- `proxyComplianceEnabled()`
73-
- `cacheComplianceEnabled()`
74-
- `generatorScopeComplianceEnabled()`
75-
- `loadByIdComplianceEnabled()`
76-
77-
The default value for these settings is still `false`.
78-
79-
To indicate a specific flag setting, or to override the generic value that was set with `JpaComplianceSettings.JPA_COMPLIANCE`, `@Jpa` 's `integrationSettings` array should be used.
80-
81-
Example:
82-
83-
```
84-
@Jpa(annotatedClasses =
85-
...,
86-
integrationSettings = {
87-
// set all jpa compliance flags to true
88-
@Setting(name = JpaComplianceSettings.JPA_COMPLIANCE, value = "true"),
89-
// override or set a specific flag value to false
90-
@Setting(name = JpaComplianceSettings.JPA_PROXY_COMPLIANCE, value = "false")
91-
}
92-
)
93-
```
94-
9546

9647
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9748
// SPI changes
@@ -102,22 +53,6 @@ Example:
10253

10354
This section describes changes to contracts (classes, interfaces, methods, etc.) which are considered https://hibernate.org/community/compatibility-policy/#spi[SPI].
10455

105-
[[registry-generic-signatures]]
106-
=== Registry Generic Signatures
107-
108-
Some operations of `TypeConfiguration`, `JavaTypeRegistry`, and `BasicTypeRegistry` had previously used unbound type parameters in the return type. The generic signatures of these methods have been changed for improved type safety.
109-
110-
111-
[[AzureSQLServerDialect]]
112-
=== AzureSQLServerDialect Deprecation
113-
114-
`org.hibernate.dialect.AzureSQLServerDialect` was deprecated; use `org.hibernate.dialect.SQLServerDialect` instead.
115-
116-
[IMPORTANT]
117-
====
118-
If you set `hibernate.boot.allow_jdbc_metadata_access=false` for offline startup,
119-
remember to also set the targeted database version through `jakarta.persistence.database-product-version` - this would be 16.0 for SQL Server 2022 or 17.0 for SQL Server 2025.
120-
====
12156

12257
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12358
// Changes in Behavior
@@ -126,80 +61,8 @@ remember to also set the targeted database version through `jakarta.persistence.
12661
[[behavior-changes]]
12762
== Changes in Behavior
12863

129-
[[child-session-flush-close]]
130-
=== Child Session Flush/Close Behavior
64+
This section describes changes in behavior that applications should be aware of.
13165

132-
`Session` and `StatelessSession` which share transactional context with a parent now have slightly different semantics in regard to flushing and closing -
133-
134-
* when the parent is flushed, the child is flushed
135-
* when the parent is closed, the child is closed
136-
137-
[NOTE]
138-
====
139-
This led to a change in triggering of flush events for both -
140-
141-
* `SessionEventListener` registrations
142-
* JFR events
143-
144-
In both cases, the events are now triggered regardless of whether any entities or collections were actually flushed.
145-
Each already carried the number of entities and the number of collections which were actually flushed.
146-
Previously, when no entities and no collections were flushed to the database no event was generated; the event is now generated and both values will be zero.
147-
148-
Interestingly, this now also aligns with handling for auto-flush events which already always triggered these events.
149-
====
150-
151-
152-
[[child-session-no-interceptor]]
153-
=== Child Session No-Interceptor Behavior
154-
155-
The behavior of `noInterceptor()` for `SharedSessionBuilder` and (the new) `SharedStatelessSessionBuilder` was aligned with the preexisting semantics of this method on `SessionBuilder` and `StatelessSessionBuilder`.
156-
The previous behavior may be recovered by calling `noSessionInterceptorCreation()`.
157-
158-
[[test-util-bytecodeenhanced-engine]]
159-
=== JUnit `BytecodeEnhancedTestEngine`
160-
161-
With this version, `BytecodeEnhancedTestEngine` will be disabled by default.
162-
To be able to run the tests annotated with `@BytecodeEnhanced`, this engine has to be explicitly enabled via a system property:
163-
164-
[source, properties]
165-
----
166-
hibernate.testing.bytecode.enhancement.extension.engine.enabled=true
167-
----
168-
169-
For a Maven-based project this can be done as part of the failsafe/surefire plugin configuration:
170-
171-
[source, xml]
172-
----
173-
<plugin>
174-
<groupId>org.apache.maven.plugins</groupId>
175-
<artifactId>maven-surefire-plugin</artifactId>
176-
<configuration>
177-
<systemPropertyVariables>
178-
<hibernate.testing.bytecode.enhancement.extension.engine.enabled>true</hibernate.testing.bytecode.enhancement.extension.engine.enabled>
179-
<!-- Any other system properties required by your tests -->
180-
</systemPropertyVariables>
181-
<!-- The rest of the testing plugin configuration -->
182-
<!-- ... -->
183-
</configuration>
184-
</plugin>
185-
----
186-
187-
While for a Gradle-based project this can be done in multiple ways, it essentially comes down to configuring the
188-
link:https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html#org.gradle.api.tasks.testing.Test:systemProperties[`systemProperties`]
189-
of a `Test` task:
190-
191-
[source, groovy]
192-
----
193-
tasks.withType(Test.class) {
194-
// Enable bytecode enhanced engine:
195-
systemProperties.systemProperties['hibernate.testing.bytecode.enhancement.extension.engine.enabled'] = true
196-
// Any other test task configurations
197-
// ...
198-
}
199-
----
200-
201-
Also, this engine is expected to only work with the exact version of JUnit that `org.hibernate.orm:hibernate-testing` depends on.
202-
While it may work with other versions as well, there is no guarantee of that.
20366

20467
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20568
// DDL changes
@@ -217,9 +80,3 @@ Such changes typically do not impact programs using a relational schema managed
21780

21881
This section describes changes to dependencies used by Hibernate ORM.
21982

220-
[[junit6]]
221-
=== JUnit 6 update
222-
223-
Hibernate ORM test utils distributed as `org.hibernate.orm:hibernate-testing` are now based on JUnit 6.0.
224-
In general, this update is compatible with previous JUnit 5 versions unless the tests depended on the
225-
<<test-util-bytecodeenhanced-engine,@BytecodeEnhanced extension>>.

whats-new.adoc

Lines changed: 1 addition & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
:toc2:
33
:sectanchors:
44
:toclevels: 4
5-
:version: 7.2
5+
:version: 7.3
66
:docsBase: https://docs.jboss.org/hibernate/orm
77
:versionDocBase: {docsBase}/{version}
88
:userGuideBase: {versionDocBase}/userguide/html_single/Hibernate_User_Guide.html
@@ -11,141 +11,3 @@
1111
Describes the new features and capabilities added to Hibernate ORM in {version}.
1212

1313
IMPORTANT: If migrating from earlier versions, be sure to also check out the link:{migrationGuide}[Migration Guide] for discussion of impactful changes.
14-
15-
[[embedded-table]]
16-
== @EmbeddedTable
17-
18-
The Jakarta Persistence compliant way to specify the table to which an embedded value maps is tedious, at best, requiring us of multiple `@AttributeOverride` and/or `@AssociationOverride` annotations -
19-
20-
====
21-
[source,java]
22-
----
23-
@Entity
24-
@Table(name="primary")
25-
@SecondaryTable(name="secondary")
26-
class Person {
27-
...
28-
29-
@Embedded
30-
@AttributeOverride(name="street",
31-
column=@Column(table="secondary"))
32-
@AttributeOverride(name="city",
33-
column=@Column(table="secondary"))
34-
@AttributeOverride(name="state",
35-
column=@Column(table="secondary"))
36-
@AttributeOverride(name="zip",
37-
column=@Column(table="secondary"))
38-
Address address;
39-
}
40-
----
41-
====
42-
43-
Hibernate now provides the `EmbeddedTable` annotation to help make this easier -
44-
45-
====
46-
[source,java]
47-
----
48-
@Entity
49-
@Table(name="primary")
50-
@SecondaryTable(name="secondary")
51-
class Person {
52-
...
53-
54-
@Embedded
55-
@EmbeddedTable("secondary")
56-
Address address;
57-
}
58-
----
59-
====
60-
61-
The annotation is only legal on top-level embedded. Placement on nested embedded values will be ignored.
62-
63-
[[read-only-replicas]]
64-
== Read-only replicas
65-
66-
This release features experimental support for accessing data held in {versionDocBase}/introduction/html_single/#read-only-replicas[read only replicas] of the main database.
67-
68-
[[FindMultipleOption]]
69-
== Introduction of FindMultipleOption
70-
71-
Previous versions of Hibernate supported loading multiple entities of a type via the `Session#byMultipleIds` method.
72-
7.0 added `Session#findMultiple` methods which accepted `FindOption` configuration; but, for options specific to multiple-id loading, users still had to revert to `Session#byMultipleIds`.
73-
7.2 covers this gap and introduces new `FindMultipleOption` configuration -
74-
75-
* `SessionCheckMode`
76-
* `OrderingMode`
77-
* `RemovalsMode`
78-
79-
`Session#byMultipleIds` and `MultiIdentifierLoadAccess` have been deprecated.
80-
81-
[[child-stateless-sessions]]
82-
== Child StatelessSession
83-
84-
Creation of child `StatelessSession` is now supported, just as with child `Session`.
85-
This is a `StatelessSession` which shares "transactional context" with a parent `Session` or `StatelessSession`.
86-
Use `Session#statelessWithOptions` or `StatelessSession#statelessWithOptions` instead of `#sessionWithOptions`.
87-
88-
====
89-
[source,java]
90-
----
91-
Session parent = ...;
92-
StatelessSession child = parent
93-
.statelessWithOptions()
94-
.connection()
95-
...
96-
.open();
97-
----
98-
====
99-
100-
[[vector-module-enhancements]]
101-
== Hibernate-Vector module enhancements
102-
103-
Support for binary, float16 and sparse vectors were added.
104-
105-
====
106-
[source, java, indent=0]
107-
----
108-
@Entity
109-
public class MyEntity {
110-
@Id
111-
UUID id;
112-
@JdbcTypeCode(SqlTypes.VECTOR_BINARY)
113-
@Array(length = 24) // Refers to the bit count
114-
byte[] binaryVector;
115-
@JdbcTypeCode(SqlTypes.VECTOR_FLOAT16)
116-
@Array(length = 3)
117-
float[] float16Vector;
118-
@Array(length = 3)
119-
SparseFloatVector sparseFloat32Vector;
120-
}
121-
----
122-
====
123-
124-
The Hibernate Vector module currently ships with 3 sparse vector types:
125-
126-
* `SparseByteVector`
127-
* `SparseFloatVector`
128-
* `SparseDoubleVector`
129-
130-
In addition to accessing the sparse indices and values, they also implement the `List` interface to provide access
131-
as if it were a dense vector.
132-
133-
Also, support for vectors in the following databases was added:
134-
135-
* https://dev.mysql.com/doc/refman/9.4/en/vector-functions.html[MySQL 9.0+]
136-
* https://www.ibm.com/docs/en/db2/12.1.0?topic=list-vector-values[DB2 12.1+]
137-
* https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-vector-engine-guide/sap-hana-cloud-sap-hana-database-vector-engine-guide[SAP HANA Cloud QRC 4/2024+]
138-
* https://learn.microsoft.com/en-us/sql/t-sql/data-types/vector-data-type?view=sql-server-ver17[SQL Server 2025+]
139-
140-
== Enhancements to SchemaManager
141-
142-
Two new methods were added to `SchemaManager`:
143-
144-
- `resynchronizeGenerators()` force all sequences to catch up with data imported to their corresponding tables
145-
- `truncateTable()` truncates a single table and resets its corresponding primary key sequence
146-
147-
In addition, `truncate()` now automatically resets all primary key sequences and tables backing table generators.
148-
149-
== Regular expression support in HQL
150-
151-
The operators `like regexp` and `ilike regexp` were added to HQL, allowing {versionDocBase}/querylanguage/html_single/#like-predicate[patterns to be written as regular expressions].

0 commit comments

Comments
 (0)