diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2024-08-01 13:50:52 +0100 |
---|---|---|
committer | adheli.tavares <adheli.tavares@est.tech> | 2024-08-01 13:52:09 +0100 |
commit | a029ccab07f2dd71286804da620c513da9fdfc0e (patch) | |
tree | 64e31fd4157120a8aee87a84c2481c825b4ac221 | |
parent | d6e6d390f583fa860e98f8e4e2b71dac2a6604aa (diff) |
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 <adheli.tavares@est.tech>
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<C extends PfConcept, A extends PfNameVersion> extends PfConcept implements PfConceptGetter<C>, PfAuthorative<List<Map<String, A>>> { @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 @@ <scope>test</scope> </dependency> <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-core-jakarta</artifactId> - </dependency> - <dependency> - <groupId>org.hibernate.validator</groupId> - <artifactId>hibernate-validator</artifactId> + <groupId>org.hibernate.orm</groupId> + <artifactId>hibernate-core</artifactId> </dependency> </dependencies> </project> 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========================================================= --> -<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> +<persistence version="3.1" xmlns="https://jakarta.ee/xml/ns/persistence" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd"> <persistence-unit name="DaoTest" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <class>org.onap.policy.models.dao.converters.CDataConditioner</class> @@ -32,8 +34,8 @@ <class>org.onap.policy.models.dao.DummyReferenceTimestampEntity</class> <properties> - <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create" /> - <property name="hibernate.show_sql" value="false" /> + <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create"/> + <property name="hibernate.show_sql" value="false"/> </properties> </persistence-unit> </persistence> 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========================================================= --> -<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> +<persistence version="3.1" xmlns="https://jakarta.ee/xml/ns/persistence" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd"> <persistence-unit name="ToscaConceptTest" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <class>org.onap.policy.models.pap.persistence.concepts.JpaPolicyAudit</class> <properties> - <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create" /> - <property name="hibernate.show_sql" value="false" /> + <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create"/> + <property name="hibernate.show_sql" value="false"/> </properties> </persistence-unit> </persistence> 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========================================================= --> -<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> +<persistence version="3.1" xmlns="https://jakarta.ee/xml/ns/persistence" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd"> <persistence-unit name="ToscaConceptTest" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <class>org.onap.policy.models.dao.converters.CDataConditioner</class> @@ -37,8 +39,8 @@ <class>org.onap.policy.models.tosca.simple.concepts.JpaToscaProperty</class> <properties> - <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create" /> - <property name="hibernate.show_sql" value="false" /> + <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create"/> + <property name="hibernate.show_sql" value="false"/> </properties> </persistence-unit> </persistence> 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========================================================= --> -<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> +<persistence version="3.1" xmlns="https://jakarta.ee/xml/ns/persistence" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd"> <persistence-unit name="ToscaConceptTest" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <class>org.onap.policy.models.base.PfConceptKey</class> @@ -57,9 +59,9 @@ <class>org.onap.policy.models.tosca.simple.concepts.JpaToscaTrigger</class> <properties> - <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create" /> - <property name="hibernate.enable_lazy_load_no_trans" value="true" /> - <property name="hibernate.show_sql" value="false" /> + <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create"/> + <property name="hibernate.enable_lazy_load_no_trans" value="true"/> + <property name="hibernate.show_sql" value="false"/> </properties> </persistence-unit> </persistence> 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========================================================= --> -<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="2.0"> +<persistence version="3.1" xmlns="https://jakarta.ee/xml/ns/persistence" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_1.xsd"> <persistence-unit name="ToscaConceptTest" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider> <class>org.onap.policy.models.base.PfConceptKey</class> @@ -50,8 +52,8 @@ <class>org.onap.policy.models.tosca.simple.concepts.JpaToscaTrigger</class> <properties> - <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create" /> - <property name="hibernate.show_sql" value="false" /> + <property name="jakarta.persistence.schema-generation.database.action" value="drop-and-create"/> + <property name="hibernate.show_sql" value="false"/> </properties> </persistence-unit> </persistence> |