Update MergePersistenceUnitManager and JPA persistence infrastructure for Hibernate 6#8
Open
devin-ai-integration[bot] wants to merge 2 commits intodevelop-7.0.xfrom
Conversation
- Update Hibernate from 5.6.15.Final to 6.4.10.Final - Change groupId from org.hibernate to org.hibernate.orm - Update artifact names: remove -jakarta suffix (hibernate-core-jakarta -> hibernate-core, etc.) - Update JCache property namespace: hibernate.javax.cache.* -> hibernate.jakarta.cache.* - Update persistence XML namespace to jakarta.ee JPA 3.0 - Remove deprecated Hibernate properties (hibernate.id.new_generator_mappings, hibernate.id.optimizer.pooled.prefer_lo) - Verified MergePersistenceUnitManager, BroadleafCommonConfig, and BroadleafHibernateEnhancingClassTransformerImpl are compatible with Hibernate 6 / Spring 6 APIs Co-Authored-By: Arjun Mishra <arjunsaxmishra@gmail.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…n_factory_observer property - Update hibernate.cache.region.factory_class from org.hibernate.cache.jcache.JCacheRegionFactory to org.hibernate.cache.jcache.internal.JCacheRegionFactory (class moved in Hibernate 6) - Rename hibernate.ejb.session_factory_observer to hibernate.session_factory_observer (hibernate.ejb.* prefix removed in Hibernate 6) Co-Authored-By: Arjun Mishra <arjunsaxmishra@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Migrates the JPA persistence infrastructure from Hibernate 5.6.15.Final to Hibernate 6.4.10.Final. This is part of the broader Hibernate 6 / Spring 6 migration effort. The
MergePersistenceUnitManager,BroadleafCommonConfig, andBroadleafHibernateEnhancingClassTransformerImplwere audited and found to be compatible with Hibernate 6 / Spring 6 APIs without code changes.Labels: Enhancement, Status: ready-for-code-review
Changes
POM dependency updates (
pom.xml,common/pom.xml):5.6.15.Final→6.4.10.Finalorg.hibernate→org.hibernate.orm-jakartasuffix (hibernate-core-jakarta→hibernate-core,hibernate-envers-jakarta→hibernate-envers)javax.persistence-api,javax.el-api,org.osgi.core, self-referentialhibernate-corefromhibernate-jcache)JCache property namespace migration (
JCachePersistenceUnitPostProcessor.java,DefaultJCacheUriProvider.java):hibernate.javax.cache.*→hibernate.jakarta.cache.*in@Valueannotations, property setters, log messages, and JavadocPersistence XML updates (5 files across common, admin, core modules):
http://java.sun.com/xml/ns/persistence) to JPA 3.0 (https://jakarta.ee/xml/ns/persistence)hibernate.javax.cache.provider→hibernate.jakarta.cache.providerhibernate.cache.region.factory_classupdated fromorg.hibernate.cache.jcache.JCacheRegionFactorytoorg.hibernate.cache.jcache.internal.JCacheRegionFactory(class relocated in Hibernate 6)hibernate.ejb.session_factory_observer→hibernate.session_factory_observerinpersistence-open-admin.xml(thehibernate.ejb.*prefix was removed in Hibernate 6)hibernate.id.new_generator_mappingsandhibernate.id.optimizer.pooled.prefer_lo(these are the default behavior in Hibernate 6 and the settings are no longer recognized)Compilation verified with
mvn compile -DskipTests -pl common --also-make— BUILD SUCCESS.Human Review Checklist
hibernate.id.new_generator_mappingsandhibernate.id.optimizer.pooled.prefer_lowere removed from all persistence XMLs. Hibernate 6 defaults to the "new" generator behavior. Verify this won't cause ID generation mismatches against existing database sequences.hibernate.ejb.session_factory_observertohibernate.session_factory_observer, butSessionFactoryChangeListeneritself was not modified. Verify it still implements the correctSessionFactoryObserverinterface expected by Hibernate 6.org.hibernate.cache.jcache.internal.JCacheRegionFactory— theinternalpackage suggests this is not public API. Consider whether using the short namejcacheis more future-proof.persistence-common-test.xmlandpersistence-test.xml(inintegration/) still have the old JPA 2.0 namespace and deprecated properties — confirm whether those also need updating or are intentionally left for a separate pass.hibernate.javax.cache.*property names will need to be updated tohibernate.jakarta.cache.*to continue taking effect.javax.persistence-api,javax.el-api,org.osgi.corewere removed since Hibernate 6 no longer ships these transitive deps. Verify no classpath conflicts arise.commonmodule was compile-verified. Other modules (admin, core, framework) may surface additional Hibernate 6 API breaks in their own source files.Link to Devin session: https://app.devin.ai/sessions/46c3dcf6ddb14c178628da21e9fe2eab
Requested by: @Colhodm