Skip to content

Commit d80aa4a

Browse files
authored
Merge branch 'main' into build/jpa-snapshots
2 parents c78cd8a + 3d43c69 commit d80aa4a

File tree

145 files changed

+4865
-1326
lines changed

Some content is hidden

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

145 files changed

+4865
-1326
lines changed

README.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ See link:MAINTAINERS.md#ci[MAINTAINERS.md] for information about CI.
1818

1919
== Building from sources
2020

21-
The build requires at least JDK 21, and produces Java 17 bytecode.
21+
The build requires at least JDK 25, and produces Java 17 bytecode.
2222

2323
Hibernate uses https://gradle.org[Gradle] as its build tool. See the _Gradle Primer_ section below if you are new to
2424
Gradle.

docker_db.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,38 @@ informix_12_10() {
13701370
fi
13711371
}
13721372

1373+
spanner() {
1374+
spanner_emulator
1375+
}
1376+
1377+
spanner_emulator() {
1378+
1379+
$CONTAINER_CLI rm -f spanner || true
1380+
# Run emulator (gRPC on 9010, REST on 9020)
1381+
$CONTAINER_CLI run --name spanner -d \
1382+
-p 9010:9010 \
1383+
-p 9020:9020 \
1384+
${SPANNER_EMULATOR:-gcr.io/cloud-spanner-emulator/emulator:1.5.45}
1385+
1386+
# Wait for emulator to be ready (check logs for known messages)
1387+
n=0
1388+
until [ "$n" -ge 20 ]; do
1389+
OUTPUT="$($CONTAINER_CLI logs spanner 2>&1 || true)"
1390+
if [[ "$OUTPUT" == *"gRPC server listening"* ]] || [[ "$OUTPUT" == *"Cloud Spanner emulator running"* ]]; then
1391+
echo "Cloud Spanner emulator started."
1392+
break
1393+
fi
1394+
echo "Waiting for Cloud Spanner emulator to start..."
1395+
n=$((n+1))
1396+
sleep 3
1397+
done
1398+
1399+
if [ "$n" -ge 20 ]; then
1400+
echo "Cloud Spanner emulator failed to start after 1 minute"
1401+
exit 1
1402+
fi
1403+
}
1404+
13731405
if [ -z ${1} ]; then
13741406
echo "No db name provided"
13751407
echo "Provide one of:"
@@ -1417,6 +1449,8 @@ if [ -z ${1} ]; then
14171449
echo -e "\informix"
14181450
echo -e "\informix_14_10"
14191451
echo -e "\informix_12_10"
1452+
echo -e "\tspanner"
1453+
echo -e "\tspanner_emulator"
14201454
else
14211455
${1}
14221456
fi

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ and `org.ehcache:ehcache`
116116
and `com.github.ben-manes.caffeine:jcache`
117117
| Distributed second-level cache support via {infinispan}[Infinispan] | `org.infinispan:infinispan-hibernate-cache-v60`
118118
// | SCRAM authentication support for PostgreSQL | `com.ongres.scram:client:2.1`
119-
| A JSON serialization library for working with JSON datatypes, for example, {jackson}[Jackson] or {yasson}[Yasson] |
120-
`com.fasterxml.jackson.core:jackson-databind` +
119+
| A JSON serialization library for working with JSON datatypes, for example, {jackson}[Jackson 2], {jackson3}[Jackson 3] or {yasson}[Yasson] |
120+
`com.fasterxml.jackson.core:jackson-databind`, `tools.jackson.core:jackson-databind` +
121121
or `org.eclipse:yasson`
122122
| <<spatial,Hibernate Spatial>> | `org.hibernate.orm:hibernate-spatial`
123123
| <<envers,Envers>>, for auditing historical data | `org.hibernate.orm:hibernate-envers`

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,13 +809,20 @@ class Person {
809809
----
810810

811811
We also need to add Jackson or an implementation of JSONB—for example, Yasson—to our runtime classpath.
812-
To use Jackson we could add this line to our Gradle build:
812+
To use Jackson 2 we could add this line to our Gradle build:
813813

814814
[source,groovy]
815815
----
816816
runtimeOnly 'com.fasterxml.jackson.core:jackson-databind:{jacksonVersion}'
817817
----
818818

819+
To use Jackson 3 we could add this line to our Gradle build:
820+
821+
[source,groovy]
822+
----
823+
runtimeOnly 'tools.jackson.core:jackson-databind:{jackson3Version}'
824+
----
825+
819826
Now the `name` column of the `Author` table will have the type `jsonb`, and Hibernate will automatically use Jackson to serialize a `Name` to and from JSON format.
820827

821828
[[miscellaneous-mappings]]

documentation/src/main/asciidoc/userguide/chapters/query/hql/QueryLanguage.adoc

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,8 @@ The following functions deal with SQL array types, which are not supported on ev
12201220
| <<hql-array-slice-functions,`array_slice()`>> | Creates a sub-array of the based on lower and upper index
12211221
| <<hql-array-replace-functions,`array_replace()`>> | Creates array copy replacing a given element with another
12221222
| <<hql-array-trim-functions,`array_trim()`>> | Creates array copy trimming the last _N_ elements
1223+
| <<hql-array-reverse-functions,`array_reverse()`>> | Returns a copy of the array with elements in reverse order
1224+
| <<hql-array-sort-functions,`array_sort()`>> | Returns a sorted copy of the array
12231225
| <<hql-array-fill-functions,`array_fill()`>> | Creates array filled with the same element _N_ times
12241226
| <<hql-array-fill-functions,`array_fill_list()`>> | Like `array_fill`, but returns the result as `List<?>`
12251227
| <<hql-array-to-string-functions,`array_to_string()`>> | String representation of array
@@ -1596,6 +1598,46 @@ include::{array-example-dir-hql}/ArrayTrimTest.java[tags=hql-array-trim-example]
15961598
----
15971599
====
15981600
1601+
[[hql-array-reverse-functions]]
1602+
===== `array_reverse()`
1603+
1604+
Returns a copy of the array with elements in reverse order. Returns `null` if the argument is `null`.
1605+
1606+
[[hql-array-reverse-example]]
1607+
====
1608+
[source, java, indent=0]
1609+
----
1610+
include::{array-example-dir-hql}/ArrayReverseTest.java[tags=hql-array-reverse-example]
1611+
----
1612+
====
1613+
1614+
[[hql-array-sort-functions]]
1615+
===== `array_sort()`
1616+
1617+
Returns a sorted copy of the array. When called with no optional arguments, elements are sorted in ascending order with `null` elements placed last.
1618+
The optional second argument allows specifying descending order, and the optional third argument controls the position of `null` elements.
1619+
Returns `null` if the first argument is `null`.
1620+
1621+
[[hql-array-sort-example]]
1622+
====
1623+
[source, java, indent=0]
1624+
----
1625+
include::{array-example-dir-hql}/ArraySortTest.java[tags=hql-array-sort-example]
1626+
----
1627+
====
1628+
1629+
The second argument controls sort direction: `false` for ascending (default), `true` for descending.
1630+
The third argument controls `null` placement: `false` for nulls last, `true` for nulls first.
1631+
When the third argument is omitted, it defaults to the value of the second argument.
1632+
1633+
[[hql-array-sort-descending-nulls-last-example]]
1634+
====
1635+
[source, java, indent=0]
1636+
----
1637+
include::{array-example-dir-hql}/ArraySortTest.java[tags=hql-array-sort-descending-nulls-last-example]
1638+
----
1639+
====
1640+
15991641
[[hql-array-fill-functions]]
16001642
===== `array_fill()` and `array_fill_list()`
16011643

gradle/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
hibernateVersion=7.2.0-SNAPSHOT
1+
hibernateVersion=7.3.0-SNAPSHOT

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/CockroachLegacyDialect.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@
141141
* A {@linkplain Dialect SQL dialect} for CockroachDB.
142142
*
143143
* @author Gavin King
144+
* @author Yoobin Yoon
144145
*/
145146
public class CockroachLegacyDialect extends Dialect {
146147

@@ -485,6 +486,8 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
485486
functionFactory.arraySlice_operator();
486487
functionFactory.arrayReplace();
487488
functionFactory.arrayTrim_unnest();
489+
functionFactory.arrayReverse_unnest();
490+
functionFactory.arraySort_unnest();
488491
functionFactory.arrayFill_cockroachdb();
489492
functionFactory.arrayToString_postgresql();
490493

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/H2LegacyDialect.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
*
129129
* @author Thomas Mueller
130130
* @author Jürgen Kreitler
131+
* @author Yoobin Yoon
131132
*/
132133
public class H2LegacyDialect extends Dialect {
133134

@@ -409,6 +410,8 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
409410
functionFactory.arraySlice();
410411
functionFactory.arrayReplace_h2( getMaximumArraySize() );
411412
functionFactory.arrayTrim_trim_array();
413+
functionFactory.arrayReverse_h2( getMaximumArraySize() );
414+
functionFactory.arraySort_h2( getMaximumArraySize() );
412415
functionFactory.arrayFill_h2();
413416
functionFactory.arrayToString_h2( getMaximumArraySize() );
414417

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/HSQLLegacyDialect.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
* @author Christoph Sturm
9696
* @author Phillip Baird
9797
* @author Fred Toussi
98+
* @author Yoobin Yoon
9899
*/
99100
public class HSQLLegacyDialect extends Dialect {
100101

@@ -269,6 +270,8 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
269270
functionFactory.arraySlice_unnest();
270271
functionFactory.arrayReplace_unnest();
271272
functionFactory.arrayTrim_trim_array();
273+
functionFactory.arrayReverse_unnest();
274+
functionFactory.arraySort_hsql();
272275
functionFactory.arrayFill_hsql();
273276
functionFactory.arrayToString_hsql();
274277

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/OracleLegacyDialect.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
* @author Steve Ebersole
171171
* @author Gavin King
172172
* @author Loïc Lefèvre
173+
* @author Yoobin Yoon
173174
*/
174175
public class OracleLegacyDialect extends Dialect {
175176

@@ -384,6 +385,8 @@ public void initializeFunctionRegistry(FunctionContributions functionContributio
384385
functionFactory.arraySlice_oracle();
385386
functionFactory.arrayReplace_oracle();
386387
functionFactory.arrayTrim_oracle();
388+
functionFactory.arrayReverse_oracle();
389+
functionFactory.arraySort_oracle();
387390
functionFactory.arrayFill_oracle();
388391
functionFactory.arrayToString_oracle();
389392

0 commit comments

Comments
 (0)