From 1104b8a9b871cc8582f62eb21c2ea2652f709c45 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Thu, 4 Apr 2024 16:41:12 -0500 Subject: [PATCH] HHH-17460 - Ongoing JPA 32 work --- hibernate-envers/hibernate-envers.gradle | 5 ++++- .../internal/EnversMetadataBuildingContextImpl.java | 2 +- .../hibernate/envers/configuration/Configuration.java | 11 +++++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/hibernate-envers/hibernate-envers.gradle b/hibernate-envers/hibernate-envers.gradle index 75aa6ba8f2..80162c4f9b 100644 --- a/hibernate-envers/hibernate-envers.gradle +++ b/hibernate-envers/hibernate-envers.gradle @@ -15,8 +15,11 @@ dependencies { implementation jakartaLibs.jaxbApi implementation jakartaLibs.jaxb - implementation libs.hibernateModels implementation libs.jandex + implementation libs.hcann + + implementation "org.hibernate.common:hibernate-commons-annotations:6.0.6.Final" + compileOnly libs.ant diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/boot/internal/EnversMetadataBuildingContextImpl.java b/hibernate-envers/src/main/java/org/hibernate/envers/boot/internal/EnversMetadataBuildingContextImpl.java index 6d37a6f5c4..b07c180629 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/boot/internal/EnversMetadataBuildingContextImpl.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/boot/internal/EnversMetadataBuildingContextImpl.java @@ -108,7 +108,7 @@ public class EnversMetadataBuildingContextImpl implements EnversMetadataBuilding @Override public ReflectionManager getReflectionManager() { - return metadataCollector.getBootstrapContext().getReflectionManager(); + return configuration.getReflectionManager(); } @Override diff --git a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/Configuration.java b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/Configuration.java index 9b9dbe86c0..04ebc1e536 100644 --- a/hibernate-envers/src/main/java/org/hibernate/envers/configuration/Configuration.java +++ b/hibernate-envers/src/main/java/org/hibernate/envers/configuration/Configuration.java @@ -12,6 +12,7 @@ import java.util.Properties; import java.util.concurrent.Callable; import org.hibernate.annotations.common.reflection.ReflectionManager; +import org.hibernate.annotations.common.reflection.java.JavaReflectionManager; import org.hibernate.boot.registry.classloading.spi.ClassLoadingException; import org.hibernate.boot.registry.selector.spi.StrategySelector; import org.hibernate.boot.spi.MetadataImplementor; @@ -74,6 +75,7 @@ public class Configuration { private final boolean globalLegacyRelationTargetNotFound; private final boolean trackEntitiesChanged; + private final JavaReflectionManager reflectionManager; private boolean trackEntitiesOverride; private final String auditTablePrefix; @@ -185,13 +187,14 @@ public class Configuration { // todo: there are places that need bits built from the revinfo entity configuration // this exists here as a way to pass it down in an immutable way to any consumer of this class - final ReflectionManager reflectionManager = - metadata.getMetadataBuildingOptions().getTypeConfiguration() - .getMetadataBuildingContext().getBootstrapContext() - .getReflectionManager(); + this.reflectionManager = new JavaReflectionManager(); this.revisionInfo = new RevisionInfoConfiguration( this, metadata, reflectionManager ); } + public JavaReflectionManager getReflectionManager() { + return reflectionManager; + } + public boolean isGenerateRevisionsForCollections() { return generateRevisionsForCollections; }