From ccdc1b0814aa5609ade406a791128eb89bbc76e0 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Thu, 2 Feb 2023 14:42:33 +0000 Subject: Replace Eclipselink with Hibernate Issue-ID: POLICY-4533 Change-Id: I9d2e4d90bf997935efad16e8ae4473d635ae9d65 Signed-off-by: liamfallon --- integrity-audit/pom.xml | 13 +++--- .../policy/common/ia/jpa/IntegrityAuditEntity.java | 8 +++- .../src/main/resources/META-INF/persistence.xml | 49 +++++++++++----------- 3 files changed, 37 insertions(+), 33 deletions(-) (limited to 'integrity-audit') diff --git a/integrity-audit/pom.xml b/integrity-audit/pom.xml index edb4f2d9..18f5536a 100644 --- a/integrity-audit/pom.xml +++ b/integrity-audit/pom.xml @@ -19,10 +19,7 @@ ============LICENSE_END========================================================= --> - + 4.0.0 @@ -68,8 +65,12 @@ h2 - org.eclipse.persistence - eclipselink + org.hibernate.javax.persistence + hibernate-jpa-2.1-api + + + org.hibernate + hibernate-entitymanager org.onap.policy.common diff --git a/integrity-audit/src/main/java/org/onap/policy/common/ia/jpa/IntegrityAuditEntity.java b/integrity-audit/src/main/java/org/onap/policy/common/ia/jpa/IntegrityAuditEntity.java index 37688859..07b85579 100644 --- a/integrity-audit/src/main/java/org/onap/policy/common/ia/jpa/IntegrityAuditEntity.java +++ b/integrity-audit/src/main/java/org/onap/policy/common/ia/jpa/IntegrityAuditEntity.java @@ -3,6 +3,7 @@ * Integrity Audit * ================================================================================ * Copyright (C) 2017-2018, 2020-2021 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2023 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +30,7 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.PrePersist; import javax.persistence.PreUpdate; @@ -46,8 +48,10 @@ import org.onap.policy.common.ia.AuditorTime; @Entity @Table(name = "IntegrityAuditEntity") -@NamedQuery(name = " IntegrityAuditEntity.findAll", query = "SELECT e FROM IntegrityAuditEntity e ") -@NamedQuery(name = "IntegrityAuditEntity.deleteAll", query = "DELETE FROM IntegrityAuditEntity WHERE 1=1") +@NamedQueries({ + @NamedQuery(name = " IntegrityAuditEntity.findAll", query = "SELECT e FROM IntegrityAuditEntity e "), + @NamedQuery(name = "IntegrityAuditEntity.deleteAll", query = "DELETE FROM IntegrityAuditEntity WHERE 1=1") +}) @NoArgsConstructor @Getter @Setter diff --git a/integrity-audit/src/main/resources/META-INF/persistence.xml b/integrity-audit/src/main/resources/META-INF/persistence.xml index 33c701b1..b648cd63 100644 --- a/integrity-audit/src/main/resources/META-INF/persistence.xml +++ b/integrity-audit/src/main/resources/META-INF/persistence.xml @@ -4,13 +4,14 @@ Integrity Audit ================================================================================ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + Modifications Copyright (C) 2023 Nordix Foundation. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at - + http://www.apache.org/licenses/LICENSE-2.0 - + Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -19,28 +20,26 @@ ============LICENSE_END========================================================= --> - - - - org.eclipse.persistence.jpa.PersistenceProvider - org.onap.policy.common.ia.jpa.IntegrityAuditEntity - org.onap.policy.common.ia.jpa.IaTestEntity - NONE - - - - + + + + org.onap.policy.common.ia.jpa.IntegrityAuditEntity + org.onap.policy.common.ia.jpa.IaTestEntity + NONE + + + + + - - - org.eclipse.persistence.jpa.PersistenceProvider - org.onap.policy.common.ia.jpa.IntegrityAuditEntity - NONE - - - - + + + org.onap.policy.common.ia.jpa.IntegrityAuditEntity + NONE + + + + -- cgit 1.2.3-korg