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
@@ -22,11 +22,6 @@ earlier versions, see any other pertinent migration guides as well.
22
22
23
23
See the link:{releaseSeriesBase}[website] for the list of requirements for the {version} series.
24
24
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.
30
25
31
26
32
27
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -48,50 +43,6 @@ See the link:{releaseSeriesBase}#whats-new[website] for the list of new features
48
43
49
44
This section describes changes to contracts (classes, interfaces, methods, etc.) which are considered https://hibernate.org/community/compatibility-policy/#api[API].
50
45
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
-
95
46
96
47
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97
48
// SPI changes
@@ -102,22 +53,6 @@ Example:
102
53
103
54
This section describes changes to contracts (classes, interfaces, methods, etc.) which are considered https://hibernate.org/community/compatibility-policy/#spi[SPI].
104
55
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
-
====
121
56
122
57
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123
58
// Changes in Behavior
@@ -126,80 +61,8 @@ remember to also set the targeted database version through `jakarta.persistence.
126
61
[[behavior-changes]]
127
62
== Changes in Behavior
128
63
129
-
[[child-session-flush-close]]
130
-
=== Child Session Flush/Close Behavior
64
+
This section describes changes in behavior that applications should be aware of.
131
65
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:
Describes the new features and capabilities added to Hibernate ORM in {version}.
12
12
13
13
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:
* 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