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

Add support for Hibernate 6 #348

Merged
merged 20 commits into from
Sep 23, 2022
Merged

Conversation

ldziedziul
Copy link
Contributor

@ldziedziul ldziedziul commented Sep 12, 2022

Fixes: #194
Fixes: #239

@ldziedziul ldziedziul self-assigned this Sep 12, 2022
@ldziedziul ldziedziul requested a review from a team as a code owner September 12, 2022 16:39
Comment on lines 35 to 36
@javax.persistence.GeneratedValue(generator = "increment")
@jakarta.persistence.GeneratedValue(generator = "increment")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the way... to avoid duplication of the code for tests against Hibernate 5 and 6

Copy link
Collaborator

@frant-hartm frant-hartm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pom.xml Outdated
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is required to run the tests then the scope should be test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why, but it's needed for compilation against Hibernate 6, otherwise we got:

hazelcast-hibernate/hazelcast-hibernate53/src/main/java/com/hazelcast/hibernate/AbstractHazelcastCacheRegionFactory.java:[47,17] cannot access jakarta.persistence.PersistenceException
[ERROR]   class file for jakarta.persistence.PersistenceException not found

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the latest changes this seems to work fine with test scope.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it fails with test scope: mvn clean verify -Dhazelcast.version=5.1.3 -Dhibernate.core.version=6.1.3.Final

@ldziedziul
Copy link
Contributor Author

ldziedziul commented Sep 13, 2022

Shouldn't this PR update the following:

https://github.com/hazelcast/hazelcast-hibernate/blob/master/.github/workflows/compatibility-builds.yml#L13

Yes :) , forgot to push it: a36cd04

Comment on lines +47 to +52
- name: Publish Test Results
uses: EnricoMi/[email protected]
if: ${{ !cancelled() }}
with:
check_name: Test results
files: '**/*-reports/TEST-*.xml'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this visible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be visible as a PR comment and as a check: https://github.com/EnricoMi/publish-unit-test-result-action#publishing-test-results (after the merge of this PR)

@@ -27,7 +27,6 @@

<properties>
<hibernate.core.version>5.3.7.Final</hibernate.core.version>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this property here? should we have just one in the root pom, and up-to-date?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed: 2f5599b

pom.xml Outdated
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the latest changes this seems to work fine with test scope.

Copy link
Collaborator

@frant-hartm frant-hartm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work. Thanks!

@ldziedziul ldziedziul merged commit 5861ebb into hazelcast:master Sep 23, 2022
@ldziedziul ldziedziul deleted the hibernate-6 branch September 23, 2022 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove CONFIG_FILE_PATH_LEGACY Ensure Hibernate 6 compatibility
3 participants