From a029ccab07f2dd71286804da620c513da9fdfc0e Mon Sep 17 00:00:00 2001 From: "adheli.tavares" Date: Thu, 1 Aug 2024 13:50:52 +0100 Subject: [PATCH] Fix on persistence.xml after updating hibernate dependencies - fix on side effects from drools-apps fix. - hibernate does not allow class annotated with @MappedSuperClass to have also @Table annotation. Issue-ID: POLICY-4955 Change-Id: I1493f58cd31646842220872c239629f3a499a9f3 Signed-off-by: adheli.tavares --- .../java/org/onap/policy/models/base/PfConceptContainer.java | 5 +---- models-dao/pom.xml | 8 ++------ models-dao/src/test/resources/META-INF/persistence.xml | 8 +++++--- models-pap/src/test/resources/META-INF/persistence.xml | 8 +++++--- models-pdp/src/test/resources/META-INF/persistence.xml | 8 +++++--- models-provider/src/test/resources/META-INF/persistence.xml | 10 ++++++---- models-tosca/src/test/resources/META-INF/persistence.xml | 8 +++++--- 7 files changed, 29 insertions(+), 26 deletions(-) diff --git a/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java b/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java index 395a42ce9..cf36756b6 100644 --- a/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java +++ b/models-base/src/main/java/org/onap/policy/models/base/PfConceptContainer.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019-2020, 2023 Nordix Foundation. + * Copyright (C) 2019-2020, 2023-2024 Nordix Foundation. * Modifications Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2022 Bell Canada. All rights reserved. * ================================================================================ @@ -29,7 +29,6 @@ import jakarta.persistence.JoinColumn; import jakarta.persistence.JoinTable; import jakarta.persistence.ManyToMany; import jakarta.persistence.MappedSuperclass; -import jakarta.persistence.Table; import jakarta.ws.rs.core.Response; import java.io.Serial; import java.lang.reflect.ParameterizedType; @@ -66,10 +65,8 @@ import org.onap.policy.models.base.validation.annotations.VerifyKey; */ //@formatter:on @MappedSuperclass -@Table(name = "PfConceptContainer") @Data @EqualsAndHashCode(callSuper = false) - public class PfConceptContainer extends PfConcept implements PfConceptGetter, PfAuthorative>> { @Serial diff --git a/models-dao/pom.xml b/models-dao/pom.xml index f10f6115a..1a3371530 100644 --- a/models-dao/pom.xml +++ b/models-dao/pom.xml @@ -51,12 +51,8 @@ test - org.hibernate - hibernate-core-jakarta - - - org.hibernate.validator - hibernate-validator + org.hibernate.orm + hibernate-core diff --git a/models-dao/src/test/resources/META-INF/persistence.xml b/models-dao/src/test/resources/META-INF/persistence.xml index f4c689cd6..8dd818f16 100644 --- a/models-dao/src/test/resources/META-INF/persistence.xml +++ b/models-dao/src/test/resources/META-INF/persistence.xml @@ -19,7 +19,9 @@ ============LICENSE_END========================================================= --> - + org.hibernate.jpa.HibernatePersistenceProvider org.onap.policy.models.dao.converters.CDataConditioner @@ -32,8 +34,8 @@ org.onap.policy.models.dao.DummyReferenceTimestampEntity - - + + diff --git a/models-pap/src/test/resources/META-INF/persistence.xml b/models-pap/src/test/resources/META-INF/persistence.xml index ffddf74d5..eccc58f92 100644 --- a/models-pap/src/test/resources/META-INF/persistence.xml +++ b/models-pap/src/test/resources/META-INF/persistence.xml @@ -19,14 +19,16 @@ ============LICENSE_END========================================================= --> - + org.hibernate.jpa.HibernatePersistenceProvider org.onap.policy.models.pap.persistence.concepts.JpaPolicyAudit - - + + diff --git a/models-pdp/src/test/resources/META-INF/persistence.xml b/models-pdp/src/test/resources/META-INF/persistence.xml index d4fb65a83..525ce5b69 100644 --- a/models-pdp/src/test/resources/META-INF/persistence.xml +++ b/models-pdp/src/test/resources/META-INF/persistence.xml @@ -21,7 +21,9 @@ ============LICENSE_END========================================================= --> - + org.hibernate.jpa.HibernatePersistenceProvider org.onap.policy.models.dao.converters.CDataConditioner @@ -37,8 +39,8 @@ org.onap.policy.models.tosca.simple.concepts.JpaToscaProperty - - + + diff --git a/models-provider/src/test/resources/META-INF/persistence.xml b/models-provider/src/test/resources/META-INF/persistence.xml index ffe7cdd61..77d265747 100644 --- a/models-provider/src/test/resources/META-INF/persistence.xml +++ b/models-provider/src/test/resources/META-INF/persistence.xml @@ -21,7 +21,9 @@ ============LICENSE_END========================================================= --> - + org.hibernate.jpa.HibernatePersistenceProvider org.onap.policy.models.base.PfConceptKey @@ -57,9 +59,9 @@ org.onap.policy.models.tosca.simple.concepts.JpaToscaTrigger - - - + + + diff --git a/models-tosca/src/test/resources/META-INF/persistence.xml b/models-tosca/src/test/resources/META-INF/persistence.xml index 422b66dfd..a4e091ce0 100644 --- a/models-tosca/src/test/resources/META-INF/persistence.xml +++ b/models-tosca/src/test/resources/META-INF/persistence.xml @@ -19,7 +19,9 @@ ============LICENSE_END========================================================= --> - + org.hibernate.jpa.HibernatePersistenceProvider org.onap.policy.models.base.PfConceptKey @@ -50,8 +52,8 @@ org.onap.policy.models.tosca.simple.concepts.JpaToscaTrigger - - + + -- 2.16.6