Skip to content

Commit 0380115

Browse files
authored
Merge branch 'hibernate:main' into main
2 parents e6bde2b + 87bab93 commit 0380115

File tree

286 files changed

+11329
-7004
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+11329
-7004
lines changed

build.gradle

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ plugins {
3939

4040
apply from: file( 'gradle/module.gradle' )
4141

42+
4243
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4344
// Release Task
4445

@@ -61,19 +62,34 @@ task publish {
6162
"themselves if they have any publish-related activities to perform"
6263
}
6364

64-
ext {
65-
if ( project.hasProperty( 'hibernatePublishUsername' ) ) {
66-
if ( ! project.hasProperty( 'hibernatePublishPassword' ) ) {
67-
throw new GradleException( "Should specify both `hibernatePublishUsername` and `hibernatePublishPassword` as project properties" );
68-
}
65+
66+
67+
def ossrhUsername = extractPropertyOrSetting( "OSSRH_USER" )
68+
def ossrhPassword = extractPropertyOrSetting( "OSSRH_PASSWORD" )
69+
70+
String extractPropertyOrSetting(String name) {
71+
if ( project.hasProperty( name) ) {
72+
return project.property( name )
73+
}
74+
75+
def sysProp = System.getProperty( name )
76+
if ( sysProp != null ) {
77+
return sysProp
6978
}
79+
80+
def envProp = System.getenv( name )
81+
if ( envProp != null ) {
82+
return envProp
83+
}
84+
85+
return null
7086
}
7187

7288
nexusPublishing {
7389
repositories {
7490
sonatype {
75-
username = project.hasProperty( 'hibernatePublishUsername' ) ? project.property( 'hibernatePublishUsername' ) : null
76-
password = project.hasProperty( 'hibernatePublishPassword' ) ? project.property( 'hibernatePublishPassword' ) : null
91+
username = ossrhUsername
92+
password = ossrhPassword
7793
}
7894
}
7995
}
@@ -82,26 +98,15 @@ gradle.taskGraph.addTaskExecutionGraphListener(
8298
new TaskExecutionGraphListener() {
8399
@Override
84100
void graphPopulated(TaskExecutionGraph graph) {
85-
String[] tasksToLookFor = [
86-
'publish',
87-
'publishToSonatype',
88-
'publishAllPublicationsToSonatype',
89-
'publishPublishedArtifactsPublicationToSonatypeRepository',
90-
'publishRelocationArtifactsPublicationToSonatypeRepository',
91-
]
92-
93-
for ( String taskToLookFor : tasksToLookFor ) {
94-
if ( graph.hasTask( taskToLookFor ) ) {
95-
// trying to publish - make sure the needed credentials are available
96-
97-
if ( project.property( 'hibernatePublishUsername' ) == null ) {
98-
throw new RuntimeException( "`-PhibernatePublishUsername=...` not found" )
101+
for ( final def task in graph.allTasks ) {
102+
if ( task instanceof PublishToMavenRepository ) {
103+
if ( ossrhUsername == null ) {
104+
throw new RuntimeException( "OSSRH username not specified, but publishing was requested" )
99105
}
100-
if ( project.property( 'hibernatePublishPassword' ) == null ) {
101-
throw new RuntimeException( "`-PhibernatePublishPassword=...` not found" )
106+
if ( ossrhPassword == null ) {
107+
throw new RuntimeException( "OSSRH password not specified, but publishing was requested" )
102108
}
103-
104-
break;
109+
break
105110
}
106111
}
107112
}
@@ -139,6 +144,3 @@ idea {
139144
name = "hibernate-orm"
140145
}
141146
}
142-
143-
144-

changelog.txt

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,72 @@ Hibernate 6 Changelog
33

44
Note: Please refer to JIRA to learn more about each issue.
55

6+
Changes in 7.0.0.Beta3 (December 05, 2024)
7+
------------------------------------------------------------------------------------------------------------------------
8+
9+
https://hibernate.atlassian.net/projects/HHH/versions/32364
10+
11+
** Bug
12+
* [HHH-18912] - Fix ORM release process
13+
* [HHH-18881] - In MySQL, array of dates are not converted correctly
14+
* [HHH-18872] - ConcreteProxy type not restored from 2LC when loading a ManyToOne
15+
* [HHH-18862] - Group by error due to subselect using foreign key reference instead of primary key in HQL query
16+
* [HHH-18859] - slice operator and @ElementCollection
17+
* [HHH-18851] - ArrayContainsArgumentTypeResolver wrongly infers array type for needle argument
18+
* [HHH-18850] - createCountQuery with Hibernate 6.6.2
19+
* [HHH-18848] - JAR for org.hibernate.orm:hibernate-scan-jandex:7.0.0.Beta2 at Maven Central
20+
* [HHH-18842] - Regression: CollectionType.replace() breaks if target is PersistentCollection, but not instance of Collection (e.g. PersistentMap)
21+
* [HHH-18832] - Bytecode enhancement skipped for entities with "compute-only" @Transient properties
22+
* [HHH-18830] - extraneous SQL UPDATE statements for unowned collection with @OrderColumn
23+
* [HHH-18826] - mappedBy validation in Processor
24+
* [HHH-18765] - Error in the booleanarray_to_string auxiliary function
25+
* [HHH-18709] - CriteriaUpdate involving JSON field containing Map<String, Object> results in SemanticException
26+
* [HHH-18705] - Hibernate processor creates bad TypedReferenceQuery when @Entity have name attribute
27+
* [HHH-18692] - Hibernate attempts to close batched statements multiple times
28+
* [HHH-18629] - Inconsistent column alias generated while result class is used for placeholder
29+
* [HHH-18610] - "SQLGrammarException: Unable to find column position by name:" when using Single Table Inheritance with a strict JDBC driver such as PostgreSQL
30+
* [HHH-18583] - Joined + discriminator inheritance treat in where clause not restricting to subtype
31+
* [HHH-18274] - Problems with generics in queries; proposed partial solution
32+
* [HHH-18069] - NullPointerException when unioning partition results
33+
* [HHH-17838] - @OneToOne relationship + @Embeddable keys + FetchType.LAZY fail in most recent version
34+
* [HHH-16054] - JPA / Hibernate, duplicate pkey error when updating entity that is a subclass of a base class that uses IdClass for composite primary key
35+
* [HHH-14119] - IN clause parameter padding not working for criteria query in conjunction with LiteralHandlingMode.BIND
36+
37+
** Improvement
38+
* [HHH-18875] - Stop using `Array.newInstance` in `org.hibernate.internal.util.collections.StandardStack`
39+
* [HHH-18861] - Improve GitHub release announcement body for automated releases
40+
* [HHH-18847] - Organize the org.hibernate.query.results package
41+
* [HHH-18844] - Run preVerifyRelease task as part of h2 CI job
42+
* [HHH-18841] - Make `_identifierMapper` property added for a IdClass synthetic
43+
* [HHH-18840] - detect and report incorrect usage of @OrderColumn, @MapKeyColumn, and @MapKey
44+
* [HHH-18683] - The method Metamodel#entity(String) should throw IllegalArgumentException for non-entities
45+
* [HHH-18534] - Remove the org.hibernate.boot.models.categorize package
46+
* [HHH-17246] - Guard against Sybase being configured for truncating trailing zeros.
47+
* [HHH-16160] - XML aggregate support for more databases
48+
* [HHH-14020] - Allow Hibernate Types to have access to ServiceRegistry during initialization
49+
* [HHH-7913] - Catalog and schema replacement in <subselect> / @Subselect
50+
51+
** New Feature
52+
* [HHH-18644] - New and improved hibernate-maven-plugin
53+
54+
** Remove Feature
55+
* [HHH-18843] - remove deprecated @OrderBy annotation
56+
57+
** Sub-task
58+
* [HHH-18804] - Add XML aggregate support for HANA
59+
* [HHH-18803] - Add XML aggregate support for DB2
60+
* [HHH-18802] - Add XML aggregate support for SQL Server
61+
* [HHH-18801] - Add XML aggregate support for Sybase ASE
62+
* [HHH-18800] - Add XML aggregate support for PostgreSQL
63+
* [HHH-18799] - Add XML aggregate support for Oracle
64+
65+
** Task
66+
* [HHH-18906] - Allow specifying UnsupportedEnhancementStrategy for Hibernate testing
67+
* [HHH-18866] - Fix more failing tests on CockroachDB
68+
* [HHH-18854] - Changes for Hibernate Reactive 3.0 integration
69+
* [HHH-18678] - Use specific tasks for CI builds
70+
71+
672
Changes in 7.0.0.Beta2 (November 13, 2024)
773
------------------------------------------------------------------------------------------------------------------------
874

ci/release/Jenkinsfile

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ def checkoutReleaseScripts() {
5353
}
5454
}
5555

56+
File findReleaseNotes() {
57+
}
58+
5659
// --------------------------------------------
5760
// Pipeline
5861

@@ -148,8 +151,6 @@ pipeline {
148151
env.RELEASE_VERSION = releaseVersion.toString()
149152
env.DEVELOPMENT_VERSION = developmentVersion.toString()
150153

151-
// def matchingFiles = findFiles(glob: "/release_notes.md")
152-
// env.SCRIPT_OPTIONS = " --notes=${matchingFiles[0]}"
153154
if ( params.RELEASE_DRY_RUN ) {
154155
env.SCRIPT_OPTIONS += " -d"
155156
}
@@ -215,7 +216,7 @@ pipeline {
215216
withEnv([
216217
"DISABLE_REMOTE_GRADLE_CACHE=true"
217218
]) {
218-
sh ".release/scripts/publish.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION} ${env.GIT_BRANCH}"
219+
sh ".release/scripts/publish.sh ${env.PROJECT} ${env.RELEASE_VERSION} ${env.DEVELOPMENT_VERSION} ${env.GIT_BRANCH} ${env.SCRIPT_OPTIONS}"
219220
}
220221
}
221222
}
@@ -242,7 +243,7 @@ pipeline {
242243
extensions: [],
243244
userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/hibernate/hibernate.org.git']]
244245
)
245-
sh "../scripts/website-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION}"
246+
sh "../scripts/website-release.sh ${env.PROJECT} ${env.RELEASE_VERSION} ${env.SCRIPT_OPTIONS} "
246247
}
247248
}
248249
}
@@ -254,8 +255,17 @@ pipeline {
254255
steps {
255256
script {
256257
checkoutReleaseScripts()
258+
259+
def notesFiles = findFiles(glob: 'release_notes.md')
260+
if ( notesFiles.length < 1 ) {
261+
throw new IllegalStateException( "Could not locate `release_notes.md`" )
262+
}
263+
if ( notesFiles.length > 1 ) {
264+
throw new IllegalStateException( "Located more than 1 `release_notes.md`" )
265+
}
266+
257267
withCredentials([string(credentialsId: 'Hibernate-CI.github.com', variable: 'GITHUB_API_TOKEN')]) {
258-
sh ".release/scripts/github-release.sh ${env.SCRIPT_OPTIONS} ${env.PROJECT} ${env.RELEASE_VERSION}"
268+
sh ".release/scripts/github-release.sh ${env.PROJECT} ${env.RELEASE_VERSION} ${env.SCRIPT_OPTIONS} --notes=${notesFiles[0].path}"
259269
}
260270
}
261271
}

documentation/documentation.gradle

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ configurations {
5252
agroal
5353
c3p0
5454
hikaricp
55-
proxool
56-
vibur
5755

5856
jcache
5957

@@ -72,8 +70,6 @@ configurations {
7270
extendsFrom agroal
7371
extendsFrom c3p0
7472
extendsFrom hikaricp
75-
extendsFrom proxool
76-
extendsFrom vibur
7773
extendsFrom jcache
7874
extendsFrom jpamodelgen
7975
}
@@ -133,9 +129,7 @@ dependencies {
133129
reportAggregation project(':hibernate-hikaricp')
134130
reportAggregation project(':hibernate-jcache')
135131
reportAggregation project(':hibernate-micrometer')
136-
reportAggregation project(':hibernate-proxool')
137132
reportAggregation project(':hibernate-spatial')
138-
reportAggregation project(':hibernate-vibur')
139133
reportAggregation project(':hibernate-ant')
140134
reportAggregation project(':hibernate-maven-plugin')
141135
reportAggregation project(':hibernate-processor')
@@ -163,12 +157,6 @@ dependencies {
163157
hikaricp project( ':hibernate-hikaricp' )
164158
javadocSources project( path: ':hibernate-hikaricp', configuration: 'javadocSources' )
165159

166-
proxool project( ':hibernate-proxool' )
167-
javadocSources project( path: ':hibernate-proxool', configuration: 'javadocSources' )
168-
169-
vibur project( ':hibernate-vibur' )
170-
javadocSources project( path: ':hibernate-vibur', configuration: 'javadocSources' )
171-
172160
jcache project( ':hibernate-jcache' )
173161
javadocSources project( path: ':hibernate-jcache', configuration: 'javadocSources' )
174162

@@ -181,11 +169,11 @@ dependencies {
181169
javadocClasspath jakartaLibs.jacc
182170
javadocClasspath jakartaLibs.jsonbApi
183171
javadocClasspath libs.ant
184-
javadocClasspath dbLibs.postgresql
172+
javadocClasspath jdbcLibs.postgresql
185173
javadocClasspath libs.jackson
186174
javadocClasspath gradleApi()
187175
javadocClasspath libs.jacksonXml
188-
javadocClasspath dbLibs.oracle
176+
javadocClasspath jdbcLibs.oracle
189177
}
190178

191179

@@ -303,7 +291,7 @@ def buildTutorialZipTask = tasks.register( 'buildTutorialZip', Zip ) { task ->
303291
version: project.version,
304292
slf4j: "2.0.7",
305293
junit: testLibs.versions.junit4.get(),
306-
h2: dbLibs.versions.h2.get()
294+
h2: jdbcLibs.versions.h2.get()
307295
)
308296
}
309297

@@ -565,12 +553,6 @@ settingsDocumentation {
565553
description = "Settings related to integrating with the C3P0 Connection pool"
566554
settingsClassName "org.hibernate.cfg.C3p0Settings"
567555
}
568-
proxool {
569-
explicitPosition = 5
570-
summary = "Proxool Connection Pool Settings"
571-
description = "Settings related to integrating with the Proxool Connection pool"
572-
settingsClassName "org.hibernate.cfg.ProxoolSettings"
573-
}
574556
transaction {
575557
explicitPosition = 6
576558
summary = "Transaction Environment Settings"

documentation/src/main/asciidoc/introduction/Advanced.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,10 @@ We happen to not much like the naming rules defined by JPA, which specify that m
582582
We bet you could easily come up with a much better `ImplicitNamingStrategy` than that!
583583
(Hint: it should always produce legit mixed case identifiers.)
584584
====
585+
585586
[TIP]
586587
====
587-
A popular `PhysicalNamingStrategy` produces snake case identifiers.
588+
The popular link:{doc-javadoc-url}org/hibernate/boot/model/naming/PhysicalNamingStrategySnakeCaseImpl.html[`PhysicalNamingStrategySnakeCaseImpl`] produces snake case identifiers.
588589
====
589590

590591
Custom naming strategies may be enabled using the configuration properties we already mentioned without much explanation back in <<minimizing>>.

documentation/src/main/asciidoc/introduction/Configuration.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,11 @@ We'll have more to say about them in <<naming-strategies>>.
503503
[[quoted-identifiers]]
504504
=== Quoting SQL identifiers
505505

506-
By default, Hibernate never quotes SQL table and column names in generated SQL.
506+
By default, Hibernate never quotes a SQL table or column name in generated SQL when the name contains only alphanumeric characters.
507507
This behavior is usually much more convenient, especially when working with a legacy schema, since unquoted identifiers aren't case-sensitive, and so Hibernate doesn't need to know or care whether a column is named `NAME`, `name`, or `Name` on the database side.
508+
On the other hand, any table or column name containing a punctuation character like `$` is automatically quoted by default.
508509

509-
The following settings enable automatic quoting:
510+
The following settings enable additional automatic quoting:
510511

511512
.Settings for identifier quoting
512513
[%breakable,cols="35,~"]

documentation/src/main/asciidoc/introduction/Tuning.adoc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ the connection pool.
3333
=== Tuning the connection pool
3434

3535
The connection pool built in to Hibernate is suitable for testing, but isn't intended for use in production.
36-
Instead, Hibernate supports a range of different connection pools, including our favorite, Agroal.
36+
Instead, Hibernate supports several different connection pools, including our favorite, Agroal.
3737

3838
To select and configure Agroal, you'll need to set some extra configuration properties, in addition to the settings we already saw in <<basic-configuration-settings>>.
3939
Properties with the prefix `hibernate.agroal` are passed through to Agroal:
@@ -48,7 +48,7 @@ hibernate.agroal.reapTimeout PT10s
4848
----
4949

5050
As long as you set at least one property with the prefix `hibernate.agroal`, the `AgroalConnectionProvider` will be selected automatically.
51-
There are many to choose from:
51+
There are many to choose from, as enumerated by link:{doc-javadoc-url}/org/hibernate/cfg/AgroalSettings.html[`AgroalSettings`]:
5252

5353
.Settings for configuring Agroal
5454
[%breakable,cols="37,~"]
@@ -72,10 +72,13 @@ The following settings are common to all connection pools supported by Hibernate
7272
.Common settings for connection pools
7373
[%breakable,cols="37,~"]
7474
|===
75-
| `hibernate.connection.autocommit` | The default autocommit mode
76-
| `hibernate.connection.isolation` | The default transaction isolation level
75+
| link:{doc-javadoc-url}/org/hibernate/cfg/JdbcSettings.html#AUTOCOMMIT[`hibernate.connection.autocommit`] | The default autocommit mode
76+
| link:{doc-javadoc-url}/org/hibernate/cfg/JdbcSettings.html#ISOLATION[`hibernate.connection.isolation`] | The default transaction isolation level
7777
|===
7878

79+
A popular alternative to Agroal is HikariCP.
80+
Its setting are enumerated by link:{doc-javadoc-url}/org/hibernate/cfg/HikariCPSettings.html[`HikariCPSettings`].
81+
7982
.Container-managed datasources
8083
****
8184
In a container environment, you usually don't need to configure a connection pool through Hibernate.

documentation/src/main/asciidoc/querylanguage/Expressions.adoc

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ Naturally, there are a good number of functions for working with strings.
841841
| `replace()` | Replace every occurrence of a pattern in a string | `replace(str, patt, rep)` | ✔ / ✖
842842
| `repeat()` | Concatenate a string with itself multiple times | `repeat(str, times)` | ✖ / ✖
843843
| `collate()` | Select a collation | `collate(p.name as collation)` | ✖ / ✖
844+
| `hex()` | Encode a binary value as a hexadecimal string | `hex(image.bytes)` | ✖ / ✖
844845
|===
845846

846847
Let's take a closer look at just some of these.
@@ -1174,8 +1175,8 @@ Finally, the following functions evaluate the id, version, or natural id of an e
11741175
|===
11751176
| Function | Purpose | JPA standard
11761177

1177-
| `id()` | The value of the entity `@Id` attribute. |
1178-
| `version()` | The value of the entity `@Version` attribute. |
1178+
| `id()` | The value of the entity `@Id` attribute. |
1179+
| `version()` | The value of the entity `@Version` attribute. |
11791180
| `naturalid()` | The value of the entity `@NaturalId` attribute. | ✖
11801181
| `fk()` | The value of the foreign key column mapped by a `@ManyToOne` (or logical `@OneToOne`) association.
11811182
Useful with associations annotated `@NotFound`. | ✖
@@ -1207,6 +1208,23 @@ However, we note that the following language constructs work with arrays, and ar
12071208
| `array includes subarray` | Determine if the elements of one array include all the elements of a second array
12081209
|===
12091210

1211+
[[functions-hash]]
1212+
=== Hash functions
1213+
1214+
The following functions work on most supported platforms:
1215+
1216+
[[hash-functions]]
1217+
[cols="12,~,^15"]
1218+
|===
1219+
| Function | Purpose | JPA standard
1220+
1221+
| `sha()` | The SHA256 hash of a string. | ✖
1222+
| `md5()` | The MD5 hash of a string. | ✖
1223+
|===
1224+
1225+
These functions accept a string and return `byte[]`.
1226+
The return value is compatible with the byte array produced by Java's `MessageDigest`.
1227+
12101228
[[embedding-sql]]
12111229
==== Embedding SQL expressions
12121230

0 commit comments

Comments
 (0)