From cc95bccb4f5c20679a3fce09c67b17f82e2a7a43 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 14:17:35 +0000 Subject: [PATCH 1/2] Update MergePersistenceUnitManager infrastructure for Hibernate 6 - 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 --- .../resources/META-INF/persistence-cms.xml | 10 +++---- .../META-INF/persistence-open-admin.xml | 8 ++---- common/pom.xml | 10 +++---- .../cache/DefaultJCacheUriProvider.java | 8 +++--- .../JCachePersistenceUnitPostProcessor.java | 8 +++--- .../resources/META-INF/persistence-common.xml | 10 +++---- .../META-INF/persistence-framework.xml | 8 ++---- .../META-INF/persistence-profile.xml | 6 ++-- pom.xml | 28 ++++--------------- 9 files changed, 36 insertions(+), 60 deletions(-) diff --git a/admin/broadleaf-contentmanagement-module/src/main/resources/META-INF/persistence-cms.xml b/admin/broadleaf-contentmanagement-module/src/main/resources/META-INF/persistence-cms.xml index 3c3f1ebca6..78aaf0627a 100644 --- a/admin/broadleaf-contentmanagement-module/src/main/resources/META-INF/persistence-cms.xml +++ b/admin/broadleaf-contentmanagement-module/src/main/resources/META-INF/persistence-cms.xml @@ -17,10 +17,10 @@ #L% --> - + xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" + version="3.0"> config/bc/jpa/domain/Page.orm.xml config/bc/jpa/domain/StructuredContent.orm.xml @@ -59,15 +59,13 @@ - + - - diff --git a/admin/broadleaf-open-admin-platform/src/main/resources/META-INF/persistence-open-admin.xml b/admin/broadleaf-open-admin-platform/src/main/resources/META-INF/persistence-open-admin.xml index ab9956c99d..4b7105c385 100644 --- a/admin/broadleaf-open-admin-platform/src/main/resources/META-INF/persistence-open-admin.xml +++ b/admin/broadleaf-open-admin-platform/src/main/resources/META-INF/persistence-open-admin.xml @@ -17,10 +17,10 @@ #L% --> - + xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" + version="3.0"> config/bc/jpa/domain/Admin.orm.xml org.broadleafcommerce.openadmin.server.security.domain.ForgotPasswordSecurityTokenImpl @@ -48,8 +48,6 @@ - - diff --git a/common/pom.xml b/common/pom.xml index 0bbfedf94c..12d06e34eb 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -142,11 +142,11 @@ - org.hibernate - hibernate-core-jakarta + org.hibernate.orm + hibernate-core - org.hibernate + org.hibernate.orm hibernate-jcache @@ -171,8 +171,8 @@ easymockclassextension - org.hibernate - hibernate-envers-jakarta + org.hibernate.orm + hibernate-envers jakarta.mail diff --git a/common/src/main/java/org/broadleafcommerce/common/extensibility/cache/DefaultJCacheUriProvider.java b/common/src/main/java/org/broadleafcommerce/common/extensibility/cache/DefaultJCacheUriProvider.java index 3cf0facfa3..9d85ab368a 100644 --- a/common/src/main/java/org/broadleafcommerce/common/extensibility/cache/DefaultJCacheUriProvider.java +++ b/common/src/main/java/org/broadleafcommerce/common/extensibility/cache/DefaultJCacheUriProvider.java @@ -34,10 +34,10 @@ public class DefaultJCacheUriProvider implements JCacheUriProvider { private static final Log LOG = LogFactory.getLog(DefaultJCacheUriProvider.class); - @Value("${hibernate.javax.cache.uri:#{null}}") + @Value("${hibernate.jakarta.cache.uri:#{null}}") protected String configLocation; - @Value("${hibernate.javax.cache.uri.relative:true}") + @Value("${hibernate.jakarta.cache.uri.relative:true}") protected boolean isLocationRelative; @Override @@ -51,11 +51,11 @@ public URI getJCacheUri() { if (url != null) { return url.toURI(); } - LOG.warn("The property hibernate.javax.cache.uri.relative was set to true however there was no resource found for " + configLocation + ". Falling back on creating a URI from the provided config location set by the property hibernate.javax.cache.uri"); + LOG.warn("The property hibernate.jakarta.cache.uri.relative was set to true however there was no resource found for " + configLocation + ". Falling back on creating a URI from the provided config location set by the property hibernate.jakarta.cache.uri"); } return new URI(configLocation); } catch (URISyntaxException e) { - throw new IllegalArgumentException("Incorrect URI syntax set for property hibernate.javax.cache.uri", e); + throw new IllegalArgumentException("Incorrect URI syntax set for property hibernate.jakarta.cache.uri", e); } } diff --git a/common/src/main/java/org/broadleafcommerce/common/extensibility/jpa/JCachePersistenceUnitPostProcessor.java b/common/src/main/java/org/broadleafcommerce/common/extensibility/jpa/JCachePersistenceUnitPostProcessor.java index add0211fa6..c62ce726e0 100644 --- a/common/src/main/java/org/broadleafcommerce/common/extensibility/jpa/JCachePersistenceUnitPostProcessor.java +++ b/common/src/main/java/org/broadleafcommerce/common/extensibility/jpa/JCachePersistenceUnitPostProcessor.java @@ -33,7 +33,7 @@ * Persistence unit post processor for dynamically modifying the persistence unit. *

* jcache.disable.cache - default: false, disables hibernate L2 and query cache if true - * hibernate.javax.cache.provider - default: null, overrides the cache provider defined in the persistence.xml + * hibernate.jakarta.cache.provider - default: null, overrides the cache provider defined in the persistence.xml * hibernate.cache.region.factory_class - default: null, overrides the cache region factory defined in the persistence.xml *

* uriProvider - A configurable provider class that returns the URI to be used for caching @@ -46,7 +46,7 @@ public class JCachePersistenceUnitPostProcessor implements PersistenceUnitPostPr @Value("${jcache.disable.cache:false}") protected Boolean disableCache; - @Value("${hibernate.javax.cache.provider:#{null}}") + @Value("${hibernate.jakarta.cache.provider:#{null}}") protected String cacheProvider; @Value("${hibernate.cache.region.factory_class:#{null}}") @@ -68,14 +68,14 @@ public void postProcessPersistenceUnitInfo(MutablePersistenceUnitInfo pui) { } URI cacheUri = uriProvider.getJCacheUri(); - properties.setProperty("hibernate.javax.cache.uri", cacheUri != null ? uriProvider.getJCacheUri().toString() : ""); + properties.setProperty("hibernate.jakarta.cache.uri", cacheUri != null ? uriProvider.getJCacheUri().toString() : ""); if (cacheRegionFactory != null) { properties.setProperty("hibernate.cache.region.factory_class", cacheRegionFactory); } if (cacheProvider != null) { - properties.setProperty("hibernate.javax.cache.provider", cacheProvider); + properties.setProperty("hibernate.jakarta.cache.provider", cacheProvider); } properties.putAll(overrideCacheProperties); diff --git a/common/src/main/resources/META-INF/persistence-common.xml b/common/src/main/resources/META-INF/persistence-common.xml index 8f71b5b373..4b3870ab1e 100644 --- a/common/src/main/resources/META-INF/persistence-common.xml +++ b/common/src/main/resources/META-INF/persistence-common.xml @@ -17,10 +17,10 @@ #L% --> - + xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" + version="3.0"> config/bc/jpa/domain/SystemProperty.orm.xml config/bc/jpa/domain/ModuleConfiguration.orm.xml @@ -55,15 +55,13 @@ - + - - diff --git a/core/broadleaf-framework/src/main/resources/META-INF/persistence-framework.xml b/core/broadleaf-framework/src/main/resources/META-INF/persistence-framework.xml index 8044f08183..4e74ba9441 100644 --- a/core/broadleaf-framework/src/main/resources/META-INF/persistence-framework.xml +++ b/core/broadleaf-framework/src/main/resources/META-INF/persistence-framework.xml @@ -17,10 +17,10 @@ #L% --> - + xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" + version="3.0"> config/bc/jpa/domain/Category.orm.xml config/bc/jpa/domain/CategoryXref.orm.xml @@ -150,8 +150,6 @@ - - diff --git a/core/broadleaf-profile/src/main/resources/META-INF/persistence-profile.xml b/core/broadleaf-profile/src/main/resources/META-INF/persistence-profile.xml index 1e4cbcd8e6..111763c967 100644 --- a/core/broadleaf-profile/src/main/resources/META-INF/persistence-profile.xml +++ b/core/broadleaf-profile/src/main/resources/META-INF/persistence-profile.xml @@ -17,10 +17,10 @@ #L% --> - + xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" + version="3.0"> config/bc/jpa/domain/Address.orm.xml config/bc/jpa/domain/ChallengeQuestion.orm.xml diff --git a/pom.xml b/pom.xml index 6836d3b269..32eadcfb39 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 3.0.3-GA 2.7.4 v20240317 - 5.6.15.Final + 6.4.10.Final 6.0.0 4.0.0 2.1.1 @@ -583,8 +583,8 @@ - org.hibernate - hibernate-envers-jakarta + org.hibernate.orm + hibernate-envers ${hibernate.version} @@ -599,26 +599,14 @@ 3.4.3.Final - org.hibernate - hibernate-core-jakarta + org.hibernate.orm + hibernate-core ${hibernate.version} org.jboss.logging jboss-logging - - javax.persistence - javax.persistence-api - - - javax.el - javax.el-api - - - org.osgi - org.osgi.core - jakarta.activation jakarta.activation-api @@ -630,7 +618,7 @@ - org.hibernate + org.hibernate.orm hibernate-jcache ${hibernate.version} @@ -638,10 +626,6 @@ javax.cache cache-api - - org.hibernate - hibernate-core - From 1920985c55c00ce06cae0df9e5bfbef0d825bdf0 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 14:26:36 +0000 Subject: [PATCH 2/2] Fix Devin Review findings: update JCacheRegionFactory path and session_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 --- .../src/main/resources/META-INF/persistence-cms.xml | 2 +- .../src/main/resources/META-INF/persistence-open-admin.xml | 2 +- common/src/main/resources/META-INF/persistence-common.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/broadleaf-contentmanagement-module/src/main/resources/META-INF/persistence-cms.xml b/admin/broadleaf-contentmanagement-module/src/main/resources/META-INF/persistence-cms.xml index 78aaf0627a..d9199de8e8 100644 --- a/admin/broadleaf-contentmanagement-module/src/main/resources/META-INF/persistence-cms.xml +++ b/admin/broadleaf-contentmanagement-module/src/main/resources/META-INF/persistence-cms.xml @@ -58,7 +58,7 @@ - + diff --git a/admin/broadleaf-open-admin-platform/src/main/resources/META-INF/persistence-open-admin.xml b/admin/broadleaf-open-admin-platform/src/main/resources/META-INF/persistence-open-admin.xml index 4b7105c385..4efc1e63dd 100644 --- a/admin/broadleaf-open-admin-platform/src/main/resources/META-INF/persistence-open-admin.xml +++ b/admin/broadleaf-open-admin-platform/src/main/resources/META-INF/persistence-open-admin.xml @@ -35,7 +35,7 @@ - + diff --git a/common/src/main/resources/META-INF/persistence-common.xml b/common/src/main/resources/META-INF/persistence-common.xml index 4b3870ab1e..867174411e 100644 --- a/common/src/main/resources/META-INF/persistence-common.xml +++ b/common/src/main/resources/META-INF/persistence-common.xml @@ -54,7 +54,7 @@ - +