Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.2 backports #7439

Merged
merged 22 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
70bd1e4
Fix Oracle 11 issues with aliases and disable FollowOnLockingTest on …
beikov Oct 12, 2023
e361ca1
Fixup changelog for 6.2.13.Final
beikov Oct 12, 2023
3954311
HHH-17157 - Some improvements to the metamodel generator documentation
jrenaat Sep 28, 2023
0a4d6bf
HHH-17157 - Some improvements to the metamodel generator documentation
sebersole Oct 11, 2023
889ed6d
HHH-17315 Reduce Oracle database user privileges to avoid cross schem…
loiclefevre Oct 13, 2023
f8a1ef8
Update checker and adapt memory configuration
beikov Oct 13, 2023
4d55bc1
HHH-17323 Add annotation processor for tests explicitly
beikov Oct 16, 2023
89fbd95
HHH-17351 Add missing basic type registration after changing preferre…
beikov Oct 24, 2023
902f619
HHH-17329 Add test for issue
mbladel Oct 18, 2023
6de3a12
HHH-17329 Resolve state for query cache for initialized proxies
mbladel Oct 18, 2023
8364459
Bump com.gradle.common-custom-user-data-gradle-plugin
dependabot[bot] Oct 30, 2023
6f928e1
HHH-17367 - Add links to the tutorial's example source code
jrenaat Oct 30, 2023
b050797
HHH-17108 Add test for issue
dreab8 Sep 8, 2023
3eba470
HHH-17108 Error In Native Query when adding two Entity's and using co…
dreab8 Sep 8, 2023
06411ae
[HHH-17294] Test verifying issue where Entity is not marked as dirty …
ElTav Oct 6, 2023
cd07742
[HHH-17294] DeepCopy non-Embedded JSON or XML JdbcTypCode attribute u…
The-Huginn Nov 8, 2023
d20daab
HHH-17102 Fix @SqlResultSetMapping issue for joined inheritance entit…
beikov Nov 10, 2023
bf82a45
HHH-17143 - More not-found fix ups
sebersole Aug 31, 2023
87e5cd9
HHH-17384 Fix `@NotFound` to-one association nullness handling
mbladel Nov 6, 2023
1d36228
HHH-17445 Don't force initialization of correlated joined table group
beikov Nov 23, 2023
6bc2f24
Adapt Quarkus build to test only necessary ORM bits
beikov Oct 12, 2023
723ed9a
Add Hibernate Search Update Dependency job execution to the build
marko-bekhta Oct 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ stage('Build') {
}
})
}
executions.put('Hibernate Search Update Dependency', {
build job: '/hibernate-search-dependency-update/6.2', propagate: true, parameters: [string(name: 'UPDATE_JOB', value: 'orm6.2'), string(name: 'ORM_REPOSITORY', value: helper.scmSource.remoteUrl), string(name: 'ORM_PULL_REQUEST_ID', value: helper.scmSource.pullRequest.id)]
})
parallel(executions)
}

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ plugins {
id 'org.hibernate.orm.database-service' apply false
id 'biz.aQute.bnd' version '6.3.1' apply false

id 'org.checkerframework' version '0.6.25'
id 'org.checkerframework' version '0.6.34'
id 'org.hibernate.orm.build.jdks'

id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
Expand Down
13 changes: 13 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,20 @@ Changes in 6.2.13.Final (October 11, 2023)
https://hibernate.atlassian.net/projects/HHH/versions/32203

** Bug
* [HHH-16933] - JSON issue on Oracle 23c
* [HHH-17225] - Right join does not return records from the right table if there's no matching record in the from clause
* [HHH-17264] - OracleAggregateSupport should use json_object to create empty json
* [HHH-17276] - Columns that are widened to LOB type aren't considered as LOBs
* [HHH-17290] - Embeddable with a primitive field cannot be set to null
* [HHH-17302] - Use nocache for MariaDB sequences

** Improvement
* [HHH-16876] - Update Oracle testing to 23c

** Task
* [HHH-17237] - Integrate Oracle Atlas for CI testing
* [HHH-17296] - Gradle 8.4 upgrade
* [HHH-17297] - Adapt limited support testing for 6.2


Changes in 6.2.12.Final (October 06, 2023)
Expand Down
93 changes: 0 additions & 93 deletions ci/jpa-3.2-tck.Jenkinsfile

This file was deleted.

19 changes: 12 additions & 7 deletions ci/quarkus.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ pipeline {
buildDiscarder(logRotator(numToKeepStr: '3', artifactNumToKeepStr: '3'))
disableConcurrentBuilds(abortPrevious: true)
}
environment {
MAVEN_OPTS = '-Xmx2g -XX:MaxMetaspaceSize=1g'
}
stages {
stage('Build') {
steps {
Expand All @@ -33,11 +30,19 @@ pipeline {
).trim()
}
dir('.release/quarkus') {
// checkout scmGit(branches: [[name: '*/orm-update']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/beikov/quarkus.git']])
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'ed25519.Hibernate-CI.github.com', url: 'https://github.com/quarkusio/quarkus.git']])
sh "git clone -b 3.2 --single-branch https://github.com/quarkusio/quarkus.git . || git reset --hard && git clean -fx && git pull"
sh "sed -i 's@<hibernate-orm.version>.*</hibernate-orm.version>@<hibernate-orm.version>${env.HIBERNATE_VERSION}</hibernate-orm.version>@' bom/application/pom.xml"
sh './mvnw -Dquickly install'
sh './mvnw -pl :quarkus-hibernate-orm -amd -pl "!integration-tests/kafka-oauth-keycloak" verify -Dstart-containers -Dtest-containers'
// Need to override the default maven configuration this way, because there is no other way to do it
sh "sed -i 's/-Xmx5g/-Xmx1920m/' ./.mvn/jvm.config"
sh "echo -e '\\n-XX:MaxMetaspaceSize=768m'>>./.mvn/jvm.config"
sh "./mvnw -Dquickly install"
// Need to kill the gradle daemons started during the Maven install run
sh "pkill -f '.*GradleDaemon.*' || true"
// Need to override the default maven configuration this way, because there is no other way to do it
sh "sed -i 's/-Xmx1920m/-Xmx1372m/' ./.mvn/jvm.config"
sh "sed -i 's/MaxMetaspaceSize=768m/MaxMetaspaceSize=512m/' ./.mvn/jvm.config"
def excludes = "'!integration-tests/kafka-oauth-keycloak,!integration-tests/kafka-sasl-elytron,!integration-tests/hibernate-search-orm-opensearch,!integration-tests/maven,!docs,!integration-tests/mongodb-client,!integration-tests/mongodb-panache,!integration-tests/mongodb-panache-kotlin,!integration-tests/mongodb-devservices,!integration-tests/mongodb-rest-data-panache,!integration-tests/liquibase-mongodb,!extensions/mongodb-client/deployment,!extensions/liquibase-mongodb/deployment,!extensions/panache/mongodb-panache/deployment,!extensions/panache/mongodb-panache-kotlin/deployment,!extensions/panache/mongodb-panache-kotlin/runtime,!extensions/panache/mongodb-rest-data-panache/deployment,!extensions/panache/mongodb-panache-common/deployment'"
sh "TESTCONTAINERS_RYUK_CONTAINER_PRIVILEGED=true ./mvnw -pl :quarkus-hibernate-orm -amd -pl ${excludes} verify -Dstart-containers -Dtest-containers -Dskip.gradle.build"
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion ci/release/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ pipeline {
def secondLastCommitter = sh(script: 'git show -s --format=\'%an\' HEAD~1', returnStdout: true).trim()
if (lastCommitter == 'Hibernate-CI' && secondLastCommitter == 'Hibernate-CI') {
print "INFO: Release skipped because last commits were for the previous release"
currentBuild.result = 'ABORTED'
currentBuild.getRawBuild().getExecutor().interrupt(Result.NOT_BUILT)
sleep(1) // Interrupt is not blocking and does not take effect immediately.
return
}

Expand Down
8 changes: 4 additions & 4 deletions docker_db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ oracle_atps() {
export SERVICE=$(echo $INFO | jq -r '.database' | jq -r '.service')
export PASSWORD=$(echo $INFO | jq -r '.database' | jq -r '.password')

curl -s -X POST "https://${HOST}.oraclecloudapps.com/ords/admin/_/sql" -H 'content-type: application/sql' -H 'accept: application/json' -basic -u admin:${PASSWORD} --data-ascii "create user hibernate_orm_test_$RUNID identified by \"Oracle_19_Password\" DEFAULT TABLESPACE DATA TEMPORARY TABLESPACE TEMP;alter user hibernate_orm_test_$RUNID quota unlimited on data;grant pdb_dba to hibernate_orm_test_$RUNID;BEGIN ords_admin.enable_schema(p_enabled => TRUE, p_schema => 'hibernate_orm_test_$RUNID', p_url_mapping_type => 'BASE_PATH', p_url_mapping_pattern => 'hibernate_orm_test_$RUNID', p_auto_rest_auth => TRUE); END;"
curl -s -X POST "https://${HOST}.oraclecloudapps.com/ords/admin/_/sql" -H 'content-type: application/sql' -H 'accept: application/json' -basic -u admin:${PASSWORD} --data-ascii "create user hibernate_orm_test_$RUNID identified by \"Oracle_19_Password\" DEFAULT TABLESPACE DATA TEMPORARY TABLESPACE TEMP;alter user hibernate_orm_test_$RUNID quota unlimited on data;grant CREATE SESSION, RESOURCE, CREATE VIEW, CREATE SYNONYM, CREATE ANY INDEX, EXECUTE ANY TYPE to hibernate_orm_test_$RUNID;"
}

oracle_db19c() {
Expand All @@ -746,7 +746,7 @@ oracle_db19c() {
/home/opc/sqlcl/bin/sql -s system/$PASSWORD@$HOST:1521/$SERVICE <<EOF
create user hibernate_orm_test_$RUNID identified by "Oracle_19_Password" DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
alter user hibernate_orm_test_$RUNID quota unlimited on users;
grant all privileges to hibernate_orm_test_$RUNID;
grant CREATE SESSION, RESOURCE, CREATE VIEW, CREATE SYNONYM, CREATE ANY INDEX, EXECUTE ANY TYPE to hibernate_orm_test_$RUNID;
EOF

}
Expand All @@ -761,7 +761,7 @@ oracle_db21c() {
/home/opc/sqlcl/bin/sql -s system/$PASSWORD@$HOST:1521/$SERVICE <<EOF
create user hibernate_orm_test_$RUNID identified by "Oracle_21_Password" DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
alter user hibernate_orm_test_$RUNID quota unlimited on users;
grant all privileges to hibernate_orm_test_$RUNID;
grant CREATE SESSION, RESOURCE, CREATE VIEW, CREATE SYNONYM, CREATE ANY INDEX, EXECUTE ANY TYPE to hibernate_orm_test_$RUNID;
EOF
}

Expand All @@ -775,7 +775,7 @@ oracle_db23c() {
/home/opc/sqlcl/bin/sql -s system/$PASSWORD@$HOST:1521/$SERVICE <<EOF
create user hibernate_orm_test_$RUNID identified by "Oracle_23_Password" DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
alter user hibernate_orm_test_$RUNID quota unlimited on users;
grant all privileges to hibernate_orm_test_$RUNID;
grant DB_DEVELOPER_ROLE to hibernate_orm_test_$RUNID;
EOF
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,9 @@ To apply the platform (BOM) in Maven
</dependency>
</dependencyManagement>
----

[[examples]]
=== Example sources
The bundled examples mentioned in this tutorial can be downloaded from link:{doc-quick-start-url}hibernate-tutorials.zip[here].

Alternatively, the example source code can also be obtained from https://github.com/hibernate/hibernate-orm/tree/{fullVersion}/documentation/src/main/asciidoc/quickstart/tutorials[Github]
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,6 @@ include::{example-dir-query}/HQLTest.java[tags=hql-api-basic-usage-example]

A program may hook into the process of building the query results by providing a `org.hibernate.transform.ResultListTransformer` or `org.hibernate.transform.TupleTransformer`.

Hibernate provides several some built-in implementations of these interfaces, for example:

[[hql-api-result-transformers-example]]
.Using a `ResultListTransformer`
====
[source, JAVA, indent=0]
----
include::{example-dir-query}/SelectDistinctTest.java[tags=hql-distinct-entity-resulttransformer-example]
----
====

See the https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/transform/ResultListTransformer.html[Javadocs] along with the built-in implementations for additional details.

//[[hql-api-parameters]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<build>
<plugins>
[...]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>...</version>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-jpamodelgen</artifactId>
<version>$currentHibernateVersion</version>
<!-- Optionally exclude transitive dependencies -->
<exclusions>
<exclusion>
<groupId>org.sample</groupId>
<artifactId>sample-dependency</artifactId>
</exclusion>
</exclusions>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
[...]
</plugins>
</build>
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
[[tooling-gradle]]
=== Gradle Plugin
=== Gradle

For integrating with https://gradle.org[Gradle], Hibernate provides the
https://plugins.gradle.org/plugin/org.hibernate.orm[org.hibernate.orm] plugin which
supports bytecode enhancement and static metamodel generation but not schema tooling.
Hibernate provides the ability to integrate both
<<tooling-gradle-enhancement,bytecode enhancement>> and <<tooling-gradle-modelgen,metamodel generation>> capabilities into Gradle builds.

[[tooling-gradle-enhancement]]
==== Bytecode Enhancement

Bytecode enhancement is incorporated into Gradle builds using Hibernate's
https://plugins.gradle.org/plugin/org.hibernate.orm[Gradle plugin].
To apply the plugin, use Gradle's `plugins {}` block:

[source,gradle]
Expand All @@ -14,24 +18,18 @@ plugins {
}
----


Applying the plugin creates a `hibernate` extension (`HibernateOrmSpec`) to configure the plugin.
By default, when the plugin is applied, support for both bytecode enhancement and static metamodel
generation is enabled.

[source,gradle]
----
hibernate {
// for illustration, let's disable both
disableEnhancement
disableJpaMetamodel
...
}
----

[[tooling-gradle-enhancement]]
==== Bytecode Enhancement
Enhancement is configured through the `enhancement` extension.

Enhancement is configured through the `enhancement` extension:
NOTE: `hibernate {}` and `enhancement {}` are separate to allow for schema tooling capabilities to be added later.

[source,gradle]
----
Expand All @@ -47,13 +45,9 @@ hibernate {

The extension is of type `EnhancementSpec` which exposes the following properties:


enableLazyInitialization:: Whether to incorporate lazy loading support into the enhanced bytecode. Defaults to `true`. This setting is deprecated for removal without a replacement.
enableDirtyTracking:: Whether to incorporate dirty tracking into the enhanced bytecode. Defaults to `true`. This setting is deprecated for removal without a replacement.
enableAssociationManagement:: Whether to add bidirectional association management into the enhanced bytecode


Which all default to false (disabled).
enableLazyInitialization:: Whether to incorporate lazy loading support into the enhanced bytecode. Defaults to `true`. This setting is deprecated for removal without a replacement. See <<BytecodeEnhancement-lazy-loading>>
enableDirtyTracking:: Whether to incorporate dirty tracking into the enhanced bytecode. Defaults to `true`. This setting is deprecated for removal without a replacement. See <<BytecodeEnhancement-dirty-tracking>>.
enableAssociationManagement:: Whether to add bidirectional association management into the enhanced bytecode. See <<BytecodeEnhancement-dirty-tracking-bidirectional>>.

It also exposes the following method forms:

Expand All @@ -65,49 +59,14 @@ It also exposes the following method forms:
[[tooling-gradle-modelgen]]
==== Static Metamodel Generation

One approach to integrate Static Metamodel generation into a Gradle build is to
use Gradle's support for annotation processors -
Static metamodel generation can be incorporated into Gradle builds via the
annotation processor provided by the `org.hibernate.orm:hibernate-jpamodelgen` artifact. Applying
an annotation processor in Gradle is super easy -


[source,gradle]
----
dependencies {
annotationProcessor "org.hibernate.orm:hibernate-jpamodelgen:${hibernateVersion}"
}
----

When the build does not need bytecode enhancement support, this is a perfectly valid solution.

The plugin supports simpler configuration of the generator using the registered
`jpaMetamodel` extension:


[source,gradle]
----
hibernate {
jpaMetamodel {
applyGeneratedAnnotation false
suppress 'raw'
generationOutputDirectory "${buildDir}/generated/sources/modelgen"
compileOutputDirectory "${buildDir}/classes/java/modelgen"
}
}
----

The extension is of type `JpaMetamodelGenerationSpec`, which exposes the following configuration properties:

applyGeneratedAnnotation:: Should the `javax.annotation.processing.Generated` annotation be added to the
generated classes. Defaults to `true`.
suppressions:: Suppressions to add to the generated classes. Defaults to `['raw', 'deprecation']`
generationOutputDirectory:: Directory where the generated metamodel classes should be created. Defaults
to `${buildDir}/generated/sources/jpaMetamodel`
[[tooling-gradle-modelgen-compile-output]]
compileOutputDirectory:: Directory where the classes compiled from the generated metamodel classes should be
created. Defaults to `${buildDir}/classes/java/jpaMetamodel`.

It also exposes the following method forms:

* applyGeneratedAnnotation(boolean)
* suppress(String)
* generationOutputDirectory(Object)
* compileOutputDirectory(Object)