Skip to content

Commit a1b010a

Browse files
authored
Merge branch 'main' into try-something
2 parents 26d22fa + 518ddb7 commit a1b010a

File tree

257 files changed

+8292
-2464
lines changed

Some content is hidden

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

257 files changed

+8292
-2464
lines changed

AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# Corporate contributors
66

77
Red Hat, Inc.
8+
Oracle, Corporation.
89

910
# Individual contributors
1011

Jenkinsfile

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,20 @@ stage('Configure') {
4040
// Don't build with HANA by default, but only do it nightly until we receive a 3rd instance
4141
// new BuildEnvironment( dbName: 'hana_cloud', dbLockableResource: 'hana-cloud', dbLockResourceAsHost: true ),
4242
new BuildEnvironment( node: 's390x' ),
43-
// We build with JDK 21, but produce Java 17 bytecode, so we test with JDK 17, to be sure everything works.
44-
new BuildEnvironment( testJdkVersion: '17' ),
43+
// We generally build with JDK 21, but our baseline is Java 17, so we test with JDK 17, to be sure everything works.
44+
// Here we even compile the main code with JDK 17, to be sure no JDK 18+ classes are depended on.
45+
new BuildEnvironment( mainJdkVersion: '17', testJdkVersion: '17' ),
4546
// We want to enable preview features when testing newer builds of OpenJDK:
4647
// even if we don't use these features, just enabling them can cause side effects
4748
// and it's useful to test that.
48-
new BuildEnvironment( testJdkVersion: '23', testJdkLauncherArgs: '--enable-preview' ),
49-
new BuildEnvironment( testJdkVersion: '24', testJdkLauncherArgs: '--enable-preview' ),
49+
new BuildEnvironment( testJdkVersion: '23', testJdkLauncherArgs: '--enable-preview', additionalOptions: '-PskipJacoco=true' ),
50+
new BuildEnvironment( testJdkVersion: '24', testJdkLauncherArgs: '--enable-preview', additionalOptions: '-PskipJacoco=true' ),
51+
new BuildEnvironment( testJdkVersion: '25', testJdkLauncherArgs: '--enable-preview', additionalOptions: '-PskipJacoco=true' ),
5052
// The following JDKs aren't supported by Hibernate ORM out-of-the box yet:
5153
// they require the use of -Dnet.bytebuddy.experimental=true.
5254
// Make sure to remove that argument as soon as possible
5355
// -- generally that requires upgrading bytebuddy after the JDK goes GA.
54-
new BuildEnvironment( testJdkVersion: '25', testJdkLauncherArgs: '--enable-preview -Dnet.bytebuddy.experimental=true' )
56+
new BuildEnvironment( testJdkVersion: '26', testJdkLauncherArgs: '--enable-preview -Dnet.bytebuddy.experimental=true', additionalOptions: '-PskipJacoco=true' )
5557
];
5658

5759
if ( env.CHANGE_ID ) {
@@ -101,13 +103,19 @@ stage('Build') {
101103
Map<String, Closure> executions = [:]
102104
Map<String, Map<String, String>> state = [:]
103105
environments.each { BuildEnvironment buildEnv ->
104-
// Don't build environments for newer JDKs when this is a PR
105-
if ( helper.scmSource.pullRequest && buildEnv.testJdkVersion ) {
106+
// Don't build environments for newer JDKs when this is a PR, unless the PR is labelled with 'jdk' or 'jdk-<version>'
107+
if ( helper.scmSource.pullRequest &&
108+
buildEnv.testJdkVersion && buildEnv.testJdkVersion.toInteger() > DEFAULT_JDK_VERSION.toInteger() &&
109+
!pullRequest.labels.contains( 'jdk' ) && !pullRequest.labels.contains( "jdk-${buildEnv.testJdkVersion}" ) ) {
106110
return
107111
}
108112
state[buildEnv.tag] = [:]
109113
executions.put(buildEnv.tag, {
110114
runBuildOnNode(buildEnv.node ?: NODE_PATTERN_BASE) {
115+
def mainJavaHome
116+
if ( buildEnv.mainJdkVersion ) {
117+
mainJavaHome = tool(name: "OpenJDK ${buildEnv.mainJdkVersion} Latest", type: 'jdk')
118+
}
111119
def testJavaHome
112120
if ( buildEnv.testJdkVersion ) {
113121
testJavaHome = tool(name: "OpenJDK ${buildEnv.testJdkVersion} Latest", type: 'jdk')
@@ -117,9 +125,17 @@ stage('Build') {
117125
// See https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md
118126
withEnv(["JAVA_HOME=${javaHome}", "PATH+JAVA=${javaHome}/bin"]) {
119127
state[buildEnv.tag]['additionalOptions'] = '-PmavenMirror=nexus-load-balancer-c4cf05fd92f43ef8.elb.us-east-1.amazonaws.com'
120-
if ( testJavaHome ) {
128+
if ( buildEnv.mainJdkVersion ) {
129+
state[buildEnv.tag]['additionalOptions'] = state[buildEnv.tag]['additionalOptions'] +
130+
" -Pmain.jdk.version=${buildEnv.mainJdkVersion}"
131+
}
132+
if ( buildEnv.testJdkVersion ) {
133+
state[buildEnv.tag]['additionalOptions'] = state[buildEnv.tag]['additionalOptions'] +
134+
" -Ptest.jdk.version=${buildEnv.testJdkVersion}"
135+
}
136+
if ( buildEnv.mainJdkVersion || buildEnv.testJdkVersion ) {
121137
state[buildEnv.tag]['additionalOptions'] = state[buildEnv.tag]['additionalOptions'] +
122-
" -Ptest.jdk.version=${buildEnv.testJdkVersion} -Porg.gradle.java.installations.paths=${javaHome},${testJavaHome}"
138+
" -Porg.gradle.java.installations.paths=${[javaHome, mainJavaHome, testJavaHome].findAll { it != null }.join(',')}"
123139
}
124140
if ( buildEnv.testJdkLauncherArgs ) {
125141
state[buildEnv.tag]['additionalOptions'] = state[buildEnv.tag]['additionalOptions'] +
@@ -205,6 +221,7 @@ stage('Build') {
205221
// Job-specific helpers
206222

207223
class BuildEnvironment {
224+
String mainJdkVersion
208225
String testJdkVersion
209226
String testJdkLauncherArgs
210227
String dbName = 'h2'

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ The following special functions make it possible to discover or narrow expressio
576576
| `cast()` | Narrow a basic type | `cast(x as Type)` | ✔
577577
| `str()` | Cast to a string | `str(x)` | ✖
578578
| `ordinal()` | Get the ordinal value of an enum | `ordinal(x)` | ✖
579+
| `string()` | Get the string-valued name of an enum | `string(x)` | ✖
579580
|===
580581

581582
Let's see what these functions do.
@@ -647,16 +648,17 @@ select str(id) from Order
647648

648649
[[function-ordinal]]
649650
[discrete]
650-
===== Extracting the ordinal value of an enum
651+
===== Extracting the ordinal value or name of an enum
651652

652-
The function `ordinal(x)` extracts the ordinal value of an enum.
653-
It supports both enum fields mapped as `ORDINAL` and `STRING`.
653+
The function `ordinal(x)` extracts the ordinal value of an enum, and the function `string(x)` extracts the name of the enum value as a string.
654654

655655
[source, hql]
656656
----
657-
select ordinal(p.type) from Phone p
657+
select ordinal(p.type), string(p.type) from Phone p
658658
----
659659

660+
Both functions work with enum fields mapped as `ORDINAL` and with enum fields mapped as `STRING`.
661+
660662
[[functions-null]]
661663
==== Functions for working with null values
662664

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ org.gradle.java.installations.auto-download=false
2828
# externalized definition of JDK versions so that they are available in both Project (build.gradle) and Settings (settings.gradle)
2929
orm.jdk.base=17
3030
orm.jdk.min=21
31-
orm.jdk.max=24
31+
# See gradlew/wrapper/gradle-wrapper.properties, https://docs.gradle.org/current/userguide/compatibility.html#java_runtime
32+
orm.jdk.max=22

0 commit comments

Comments
 (0)