Remove JPA annotations from apex-pdp code 66/126966/1
authorliamfallon <liam.fallon@est.tech>
Fri, 4 Feb 2022 10:34:28 +0000 (10:34 +0000)
committerliamfallon <liam.fallon@est.tech>
Fri, 4 Feb 2022 10:45:06 +0000 (10:45 +0000)
This review is part of a series of reviews to move the apex-pdp state
machine model to use the base model types in policy models.

Persistence of policies for apex-pdp is now implemented in PAP and API.
The historic direct load and save functionality for APEX policy state
machine models to and from databases is no longer used and no longer
supported.

This commit removes JPA annotations form apex-pdp code.

Subsequent reviews will mvoe the mdoel across to use the policy models
base model types.

Issue-ID: POLICY-1820
Change-Id: I91a45a0ca6c88f9ba4b201bad920065f95ffb31e
Signed-off-by: liamfallon <liam.fallon@est.tech>
35 files changed:
model/basic-model/pom.xml
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxArtifactKey.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInfo.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxKeyInformation.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxModel.java
model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxReferenceKey.java
model/basic-model/src/test/java/org/onap/policy/apex/model/basicmodel/concepts/DummyEntity.java
model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbum.java
model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextAlbums.java
model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextModel.java
model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchema.java
model/context-model/src/main/java/org/onap/policy/apex/model/contextmodel/concepts/AxContextSchemas.java
model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineModel.java
model/engine-model/src/main/java/org/onap/policy/apex/model/enginemodel/concepts/AxEngineStats.java
model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEvent.java
model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEventModel.java
model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxEvents.java
model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxField.java
model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxInputField.java
model/event-model/src/main/java/org/onap/policy/apex/model/eventmodel/concepts/AxOutputField.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxLogic.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicies.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicy.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxPolicyModel.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxState.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateFinalizerLogic.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateOutput.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxStateTaskReference.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTask.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskLogic.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskParameter.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTaskSelectionLogic.java
model/policy-model/src/main/java/org/onap/policy/apex/model/policymodel/concepts/AxTasks.java
testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ArtifactKeyTestEntity.java
testsuites/integration/integration-context-test/src/test/java/org/onap/policy/apex/testsuites/integration/context/entities/ReferenceKeyTestEntity.java

index a0b9f08..4d79302 100644 (file)
@@ -1,6 +1,6 @@
 <!--
   ============LICENSE_START=======================================================
-   Copyright (c) 2020 Nordix Foundation.
+   Copyright (c) 2020,2022 Nordix Foundation.
   ================================================================================
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
             <artifactId>utilities</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
-            <groupId>org.eclipse.persistence</groupId>
-            <artifactId>eclipselink</artifactId>
-        </dependency>
         <dependency>
             <groupId>javax.xml.bind</groupId>
             <artifactId>jaxb-api</artifactId>
index 1edbc9b..f5d4219 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2022 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,8 +23,6 @@ package org.onap.policy.apex.model.basicmodel.concepts;
 
 import java.util.ArrayList;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -41,7 +39,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * <p>Key validation checks that the name and version fields match the NAME_REGEXP and VERSION_REGEXP
  * regular expressions respectively.
  */
-@Embeddable
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexArtifactKey", namespace = "http://www.onap.org/policy/apex-pdp")
 
@@ -54,11 +51,9 @@ public class AxArtifactKey extends AxKey {
     private static final String NAME_TOKEN = "name";
     private static final String VERSION_TOKEN = "version";
 
-    @Column(name = NAME_TOKEN)
     @XmlElement(required = true)
     private String name;
 
-    @Column(name = VERSION_TOKEN)
     @XmlElement(required = true)
     private String version;
 
index 2e788a3..9b96d33 100644 (file)
@@ -25,10 +25,6 @@ package org.onap.policy.apex.model.basicmodel.concepts;
 import java.util.List;
 import java.util.Random;
 import java.util.UUID;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -46,9 +42,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * blank and warns if the UUID is a zero UUID.
  */
 
-@Entity
-@Table(name = "AxKeyInfo")
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexKeyInfo", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxKeyInfo", namespace = "http://www.onap.org/policy/apex-pdp",
@@ -65,15 +58,12 @@ public class AxKeyInfo extends AxConcept {
      */
     private static final Random sharedRandom = new Random();    // NOSONAR
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     private AxArtifactKey key;
 
-    @Column(name = "uuid")
     @XmlElement(name = "UUID", required = true)
     private UUID uuid;
 
-    @Column(name = "description", length = MAX_DESCRIPTION_LENGTH_8192)
     @XmlElement(required = true)
     private String description;
 
index 6da5ab3..d1cc99a 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -30,13 +30,6 @@ import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
 import java.util.UUID;
-import javax.persistence.CascadeType;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.Table;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -55,9 +48,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * the map is defined, that the key in each map entry matches the key if each entry value, and that no duplicate UUIDs
  * exist. Each key information entry is then validated individually.
  */
-@Entity
-@Table(name = "AxKeyInformation")
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AxKeyInformation", namespace = "http://www.onap.org/policy/apex-pdp",
         propOrder = { "key", "keyInfoMap" })
@@ -65,19 +55,10 @@ import org.onap.policy.common.utils.validation.Assertions;
 public class AxKeyInformation extends AxConcept implements AxConceptGetter<AxKeyInfo> {
     private static final long serialVersionUID = -2746380769017043888L;
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     private AxArtifactKey key;
 
-    // @formatter:off
-    @ManyToMany(cascade = CascadeType.ALL)
-    @JoinTable(
-            joinColumns = { @JoinColumn(name = "keyInfoMapName", referencedColumnName = "name"),
-                @JoinColumn(name = "keyInfoMapVersion", referencedColumnName = "version"), },
-            inverseJoinColumns = { @JoinColumn(name = "keyInfoName", referencedColumnName = "name"),
-                @JoinColumn(name = "keyInfoVersion", referencedColumnName = "version") })
     private Map<AxArtifactKey, AxKeyInfo> keyInfoMap;
-    // @formatter:on
 
     /**
      * The Default Constructor creates this concept with a null key.
index b29743c..5f63b9a 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,14 +25,6 @@ package org.onap.policy.apex.model.basicmodel.concepts;
 import java.util.List;
 import java.util.Set;
 import java.util.TreeSet;
-import javax.persistence.CascadeType;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -56,10 +48,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * ensure that an {@link AxArtifactKey} instance exists for every {@link AxKeyInfo} instance.
  */
 
-@Entity
-@Table(name = "AxModel")
-@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
-
 @XmlRootElement(name = "apexModel", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AxModel", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
@@ -70,14 +58,10 @@ public class AxModel extends AxConcept {
 
     private static final long serialVersionUID = -771659065637205430L;
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     private AxArtifactKey key;
 
     // @formatter:off
-    @OneToOne(cascade = CascadeType.ALL)
-    @JoinColumn(name = "keyInformationName", referencedColumnName = "name")
-    @JoinColumn(name = "keyInformationVersion", referencedColumnName = "version")
     @XmlElement(name = "keyInformation", required = true)
     @XmlJavaTypeAdapter(KeyInfoMarshalFilter.class)
     private AxKeyInformation keyInformation;
index 03a75a7..6c671d3 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2022 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,8 +23,6 @@ package org.onap.policy.apex.model.basicmodel.concepts;
 
 import java.util.ArrayList;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -50,7 +48,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * VERSION_REGEXP regular expressions respectively and that the local name fields match the
  * LOCAL_NAME_REGEXP regular expression.
  */
-@Embeddable
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexReferenceKey", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxReferenceKey", namespace = "http://www.onap.org/policy/apex-pdp", propOrder = { "parentKeyName",
@@ -76,19 +73,15 @@ public class AxReferenceKey extends AxKey {
     private static final int PARENT_LOCAL_NAME_FIELD = 2;
     private static final int LOCAL_NAME_FIELD = 3;
 
-    @Column(name = PARENT_KEY_NAME)
     @XmlElement(required = true)
     private String parentKeyName;
 
-    @Column(name = PARENT_KEY_VERSION)
     @XmlElement(required = true)
     private String parentKeyVersion;
 
-    @Column(name = PARENT_LOCAL_NAME)
     @XmlElement(required = true)
     private String parentLocalName;
 
-    @Column(name = LOCAL_NAME)
     @XmlElement(required = true)
     private String localName;
 
index 2407dab..cd8b52c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2020,2022 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -23,20 +23,13 @@ package org.onap.policy.apex.model.basicmodel.concepts;
 
 import java.util.Arrays;
 import java.util.List;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import org.onap.policy.apex.model.basicmodel.xml.AxReferenceKeyAdapter;
 
-@Entity
-@Table(name = "TestEntity")
-
 public class DummyEntity extends AxConcept {
     private static final long serialVersionUID = -2962570563281067894L;
 
-    @EmbeddedId()
     @XmlElement(name = "key", required = true)
     @XmlJavaTypeAdapter(AxReferenceKeyAdapter.class)
     protected AxReferenceKey key;
index b3880bd..d7d8a1d 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 package org.onap.policy.apex.model.contextmodel.concepts;
 
 import java.util.List;
-import javax.persistence.AttributeOverride;
-import javax.persistence.Column;
-import javax.persistence.Embedded;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -67,8 +61,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * <p>Validation checks that the album key and the context schema key are not null and that the scope field is not
  * undefined and matches the regular expression SCOPE_REGEXP.
  */
-@Entity
-@Table(name = "AxContextAlbum")
 
 @Getter
 @ToString
@@ -92,27 +84,18 @@ public class AxContextAlbum extends AxConcept {
     /** The value of scope for a context album for which a scope has not been specified. */
     public static final String SCOPE_UNDEFINED = "UNDEFINED";
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     private AxArtifactKey key;
 
-    @Column(name = SCOPE_STRING)
     @XmlElement(name = SCOPE_STRING, required = true)
     private String scope;
 
-    @Column(name = "isWritable")
     @XmlElement(name = "isWritable", required = true)
     @Setter
     private boolean isWritable;
 
-    // @formatter:off
-    @Embedded
-    @AttributeOverride(name = "name", column = @Column(name = "itemSchemaName"))
-    @AttributeOverride(name = "version", column = @Column(name = "itemSchemaVersion"))
-    @Column(name = "itemSchema")
     @XmlElement(name = "itemSchema", required = true)
     private AxArtifactKey itemSchema;
-    // @formatter:on
 
     /**
      * The default constructor creates a context album with a null artifact key. The scope of the context album is set
index aa5a89a..65247ab 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,13 +28,6 @@ import java.util.Map.Entry;
 import java.util.NavigableMap;
 import java.util.Set;
 import java.util.TreeMap;
-import javax.persistence.CascadeType;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -65,9 +58,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * map key matches the key in the map value for all album entries. Each context album entry is then validated
  * individually.
  */
-@Entity
-@Table(name = "AxContextAlbums")
-
 @Getter
 @ToString
 @EqualsAndHashCode(callSuper = false)
@@ -79,18 +69,12 @@ import org.onap.policy.common.utils.validation.Assertions;
 public final class AxContextAlbums extends AxConcept implements AxConceptGetter<AxContextAlbum> {
     private static final long serialVersionUID = -4844259809024470975L;
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     private AxArtifactKey key;
 
-    // @formatter:off
-    @OneToMany(cascade = CascadeType.ALL)
-    @JoinTable(joinColumns = {@JoinColumn(name = "contextName", referencedColumnName = "name"),
-        @JoinColumn(name = "contextVersion", referencedColumnName = "version")})
     @XmlElement(name = "albums", required = true)
     @Getter(AccessLevel.NONE)
     private Map<AxArtifactKey, AxContextAlbum> albums;
-    // @formatter:on
 
     /**
      * The Default Constructor creates a {@link AxContextAlbums} object with a null artifact key and creates an empty
index 9796fa6..e171493 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 package org.onap.policy.apex.model.contextmodel.concepts;
 
 import java.util.List;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -54,9 +49,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * <p>Validation runs {@link AxModel} validation on the model. In addition, the {@link AxContextSchemas} and
  * {@link AxContextAlbums} validation is run on the context schemas and albums in the model.
  */
-@Entity
-@Table(name = "AxContextModel")
-
 @Getter
 @ToString(callSuper = true)
 @EqualsAndHashCode(callSuper = true)
@@ -69,19 +61,11 @@ import org.onap.policy.common.utils.validation.Assertions;
 public class AxContextModel extends AxModel {
     private static final long serialVersionUID = 8800599637708309945L;
 
-    // @formatter:off
-    @OneToOne(cascade = CascadeType.ALL)
-    @JoinColumn(name = "schemasName", referencedColumnName = "name")
-    @JoinColumn(name = "schemasVersion", referencedColumnName = "version")
     @XmlElement(name = "schemas", required = true)
     private AxContextSchemas schemas;
 
-    @OneToOne(cascade = CascadeType.ALL)
-    @JoinColumn(name = "albumsName", referencedColumnName = "name")
-    @JoinColumn(name = "albumsVersion", referencedColumnName = "version")
     @XmlElement(name = "albums", required = true)
     private AxContextAlbums albums;
-    // @formatter:on
 
     /**
      * The Default Constructor creates a {@link AxContextModel} object with a null artifact key and creates an empty
index def22f4..a1560c0 100644 (file)
 package org.onap.policy.apex.model.contextmodel.concepts;
 
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -61,9 +57,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * the regular expression SCHEMA_FLAVOUR_REGEXP. Finally, validation checks that the defined schema is not a blank or
  * empty string.
  */
-@Entity
-@Table(name = "AxContextSchema")
-
 @Getter
 @ToString
 
@@ -87,15 +80,12 @@ public class AxContextSchema extends AxConcept {
     /** The maximum permissible size of a schema definition. */
     public static final int MAX_SCHEMA_SIZE = 32672; // The maximum size supported by Apache Derby
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     private AxArtifactKey key;
 
-    @Column(name = SCHEMA_FLAVOUR)
     @XmlElement(required = true)
     private String schemaFlavour;
 
-    @Column(name = "schemaDefinition", length = MAX_SCHEMA_SIZE)
     @XmlElement(name = "schemaDefinition", required = true)
     @Getter(AccessLevel.NONE)
     private String schemaDefinition;
index 1fa0cf5..a5b56f2 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,13 +28,6 @@ import java.util.Map.Entry;
 import java.util.NavigableMap;
 import java.util.Set;
 import java.util.TreeMap;
-import javax.persistence.CascadeType;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.Table;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -64,9 +57,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * container. Each context schema entry is checked to ensure that its key and value are not null and that the key
  * matches the key in the map value. Each context schema entry is then validated individually.
  */
-@Entity
-@Table(name = "AxContextSchemas")
-
 @Getter
 @ToString
 @EqualsAndHashCode(callSuper = false)
@@ -78,21 +68,12 @@ import org.onap.policy.common.utils.validation.Assertions;
 public class AxContextSchemas extends AxConcept implements AxConceptGetter<AxContextSchema> {
     private static final long serialVersionUID = -3203734282886453582L;
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     private AxArtifactKey key;
 
-    // @formatter:off
-    @ManyToMany(cascade = CascadeType.ALL)
-    @JoinTable(
-            joinColumns = {@JoinColumn(name = "contextSchemasName", referencedColumnName = "name"),
-                @JoinColumn(name = "contextSchemasVersion", referencedColumnName = "version")},
-            inverseJoinColumns = {@JoinColumn(name = "contextSchemaName", referencedColumnName = "name"),
-                @JoinColumn(name = "contextSchemaVersion", referencedColumnName = "version")})
     @XmlElement(name = "schemas", required = true)
     @Getter(AccessLevel.NONE)
     private Map<AxArtifactKey, AxContextSchema> schemas;
-    // @formatter:on
 
     /**
      * The Default Constructor creates a {@link AxContextSchemas} object with a null artifact key and creates an empty
index 23310b2..97e85c5 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019,2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,11 +24,6 @@ package org.onap.policy.apex.model.enginemodel.concepts;
 
 import java.text.SimpleDateFormat;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Enumerated;
-import javax.persistence.JoinColumn;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -58,8 +53,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * <p>Validation checks that the current state {@link AxEngineState} is defined and that the time stamp
  * is set on the engine model.
  */
-@Entity
-@Table(name = "AxEngineModel")
 @XmlRootElement(name = "apexEngineModel", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AxEngineModel", namespace = "http://www.onap.org/policy/apex-pdp",
@@ -69,21 +62,11 @@ public class AxEngineModel extends AxContextModel {
     private static final long serialVersionUID = 6381235864606564046L;
     private static final int HASH_CODE_PRIME = 32;
 
-    @Column(name = "timestamp")
     private long timestamp;
 
-    @Enumerated
-    @Column(name = "state")
     @XmlElement(required = true)
     private AxEngineState state;
 
-    @JoinColumn(name = "statsParentKeyName", referencedColumnName = "parentKeyName", updatable = false,
-                    insertable = false)
-    @JoinColumn(name = "statsParentKeyVersion", referencedColumnName = "parentKeyVersion", updatable = false,
-                    insertable = false)
-    @JoinColumn(name = "statsParentLocalName ", referencedColumnName = "parentLocalName", updatable = false,
-                    insertable = false)
-    @JoinColumn(name = "statsLocalName", referencedColumnName = "localName", updatable = false, insertable = false)
     private AxEngineStats stats;
 
     /**
index 39a9080..af5e8d4 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020,2022 Nordix Foundation.
  *  Modifications Copyright (C) 2022 Bell Canada.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,11 +26,6 @@ import io.prometheus.client.Gauge;
 import io.prometheus.client.Histogram;
 import java.text.SimpleDateFormat;
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
-import javax.persistence.Transient;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -52,9 +47,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * engine, and the time stamp of the last engine start are recorded.
  */
 
-@Entity
-@Table(name = "AxEngineStats")
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexEngineStats", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxEngineStats", namespace = "http://www.onap.org/policy/apex-pdp", propOrder = {"key", "timeStamp",
@@ -79,35 +71,27 @@ public class AxEngineStats extends AxConcept {
             .name("apex_engine_last_execution_time").labelNames(ENGINE_INSTANCE_ID)
             .help("Time taken to execute the last APEX policy in seconds.").register();
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     private AxReferenceKey key;
 
-    @Column
     @XmlElement(required = true)
     private long timeStamp;
 
-    @Column
     @XmlElement(required = true)
     private long eventCount;
 
-    @Column
     @XmlElement(required = true)
     private long lastExecutionTime;
 
-    @Column
     @XmlElement(required = true)
     private double averageExecutionTime;
 
-    @Column
     @XmlElement(required = true)
     private long upTime;
 
-    @Transient
     @Getter
     private transient long lastEnterTime;
 
-    @Column
     @XmlElement(required = true)
     private long lastStart;
 
@@ -566,4 +550,4 @@ public class AxEngineStats extends AxConcept {
 
         return Long.compare(lastStart, other.lastStart);
     }
-}
\ No newline at end of file
+}
index e3663e7..8128b3d 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020,2022 Nordix Foundation.
  *  Modifications Copyright (C) 2022 Bell Canada.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -31,12 +31,6 @@ import java.util.Set;
 import java.util.SortedMap;
 import java.util.TreeMap;
 import java.util.TreeSet;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -75,9 +69,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * is checked to ensure it matches the event parameter key on the event. Finally, the parent key of each parameter is
  * checked to ensure it matches the event key.
  */
-@Entity
-@Table(name = "AxEvent")
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexEvent", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxEvent", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
@@ -89,29 +80,23 @@ public class AxEvent extends AxConcept {
     private static final String WHITESPACE_REGEXP = "\\s+$";
 
     /** The key of the event, unique in the Apex system. */
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     // CHECKSTYLE:OFF: checkstyle:VisibilityMonitor
     protected AxArtifactKey key;
     // CHECKSTYLE:ON: checkstyle:VisibilityMonitor
 
-    @Column(name = "nameSpace")
     @XmlElement(required = true)
     private String nameSpace;
 
-    @Column(name = "source")
     @XmlElement(required = true)
     private String source;
 
-    @Column(name = "target")
     @XmlElement(required = true)
     private String target;
 
-    @OneToMany(cascade = CascadeType.ALL)
     @XmlElement(name = "parameter", required = true)
     private Map<String, AxField> parameterMap;
 
-    @Column(name = "toscaPolicyState")
     @XmlElement(required = false)
     private String toscaPolicyState;
 
@@ -581,4 +566,4 @@ public class AxEvent extends AxConcept {
 
         return 0;
     }
-}
\ No newline at end of file
+}
index 511d4f3..bb43076 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019,2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 package org.onap.policy.apex.model.eventmodel.concepts;
 
 import java.util.List;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -52,9 +47,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * {@link AxEvents} validation is run on the context schemas and events in the model.
  */
 
-@Entity
-@Table(name = "AxEventModel")
-
 @XmlRootElement(name = "apexEventModel", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AxEventModel", namespace = "http://www.onap.org/policy/apex-pdp", propOrder = { "schemas", "events" })
@@ -62,19 +54,11 @@ import org.onap.policy.common.utils.validation.Assertions;
 public class AxEventModel extends AxModel {
     private static final long serialVersionUID = 8800599637708309945L;
 
-    // @formatter:off
-    @OneToOne(cascade = CascadeType.ALL)
-    @JoinColumn(name = "schemasName", referencedColumnName = "name")
-    @JoinColumn(name = "schemasVersion", referencedColumnName = "version")
     @XmlElement(name = "schemas", required = true)
     private AxContextSchemas schemas;
 
-    @OneToOne(cascade = CascadeType.ALL)
-    @JoinColumn(name = "eventsName", referencedColumnName = "name")
-    @JoinColumn(name = "eventsVersion", referencedColumnName = "version")
     @XmlElement(name = "events", required = true)
     private AxEvents events;
-    // @formatter:on
 
     /**
      * The Default Constructor creates a {@link AxEventModel} object with a null artifact key and creates an empty event
index ea4ec57..26275a1 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020,2022 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,13 +27,6 @@ import java.util.Map.Entry;
 import java.util.NavigableMap;
 import java.util.Set;
 import java.util.TreeMap;
-import javax.persistence.CascadeType;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.Table;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -59,9 +52,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * container. Each event entry is checked to ensure that its key and value are not null and that the key matches the key
  * in the map value. Each event entry is then validated individually.
  */
-@Entity
-@Table(name = "AxEvents")
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AxEvents", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
     { "key", "eventMap" })
@@ -69,20 +59,11 @@ import org.onap.policy.common.utils.validation.Assertions;
 public class AxEvents extends AxConcept implements AxConceptGetter<AxEvent> {
     private static final long serialVersionUID = 4290442590545820316L;
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     private AxArtifactKey key;
 
-    // @formatter:off
-    @ManyToMany(cascade = CascadeType.ALL)
-    @JoinTable(
-            joinColumns = { @JoinColumn(name = "eventMapName", referencedColumnName = "name"),
-                @JoinColumn(name = "eventMapVersion", referencedColumnName = "version") },
-            inverseJoinColumns = { @JoinColumn(name = "eventName", referencedColumnName = "name"),
-                @JoinColumn(name = "eventVersion", referencedColumnName = "version") })
     @XmlElement(required = true)
     private Map<AxArtifactKey, AxEvent> eventMap;
-    // @formatter:on
 
     /**
      * The Default Constructor creates a {@link AxEvents} object with a null artifact key and creates an empty event
index 654a83c..9f98a62 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019,2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 package org.onap.policy.apex.model.eventmodel.concepts;
 
 import java.util.List;
-import javax.persistence.AttributeOverride;
-import javax.persistence.Column;
-import javax.persistence.Embedded;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -58,10 +50,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  *
  * <p>Validation checks that the field key and the field schema reference key are not null.
  */
-@Entity
-@Table(name = "AxField")
-@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexField", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxField", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
@@ -76,21 +64,13 @@ public class AxField extends AxConcept {
     private static final int HASH_PRIME_0 = 1231;
     private static final int HASH_PRIME_1 = 1237;
 
-    @EmbeddedId()
     @XmlElement(name = "key", required = true)
     @XmlJavaTypeAdapter(AxReferenceKeyAdapter.class)
     private AxReferenceKey key;
 
-    // @formatter:off
-    @Embedded
-    @AttributeOverride(name = "name", column = @Column(name = "fieldSchemaName"))
-    @AttributeOverride(name = "version", column = @Column(name = "fieldSchemaVersion"))
-    @Column(name = "fieldSchemaKey")
     @XmlElement(required = true)
     private AxArtifactKey fieldSchemaKey;
-    // @formatter:on
 
-    @Column(name = "optional")
     @XmlElement(required = false)
     private boolean optional;
 
index 1766991..2626e8b 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2022 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.apex.model.eventmodel.concepts;
 
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -34,10 +31,6 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
 /**
  * This class specializes the {@link AxField} class for use as input fields on events.
  */
-@Entity
-@Table(name = "AxInputField")
-@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexInputField", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxInputField", namespace = "http://www.onap.org/policy/apex-pdp")
index f224739..a3e8352 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2022 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 
 package org.onap.policy.apex.model.eventmodel.concepts;
 
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -34,10 +31,6 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
 /**
  * This class specializes the {@link AxField} class for use as output fields on events.
  */
-@Entity
-@Table(name = "AxOutputField")
-@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexOutputField", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxOutputField", namespace = "http://www.onap.org/policy/apex-pdp")
index 4cb55e1..a7cb97a 100644 (file)
 package org.onap.policy.apex.model.policymodel.concepts;
 
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -56,10 +50,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * the {@code LOGIC_FLAVOUR_REGEXP} regular expression, and that the specified logic string is not null or blank.
  */
 
-@Entity
-@Table(name = "AxLogic")
-@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexLogic", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxLogic", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
@@ -84,16 +74,13 @@ public class AxLogic extends AxConcept {
     /** The maximum permissible size of a logic definition. */
     public static final int MAX_LOGIC_SIZE = 32672; // The maximum size supported by Apache Derby
 
-    @EmbeddedId()
     @XmlElement(name = "key", required = true)
     @XmlJavaTypeAdapter(AxReferenceKeyAdapter.class)
     private AxReferenceKey key;
 
-    @Column(name = LOGIC_FLAVOUR_TOKEN)
     @XmlElement(required = true)
     private String logicFlavour;
 
-    @Column(name = "logic", length = MAX_LOGIC_SIZE)
     @XmlElement(required = true)
     private String logic;
 
index 922cc24..4073046 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020,2022 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,13 +27,6 @@ import java.util.Map.Entry;
 import java.util.NavigableMap;
 import java.util.Set;
 import java.util.TreeMap;
-import javax.persistence.CascadeType;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.Table;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -59,9 +52,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * container. Each policy entry is checked to ensure that its key and value are not null and that the key matches the
  * key in the map value. Each policy entry is then validated individually.
  */
-@Entity
-@Table(name = "AxPolicies")
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AxPolicies", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
     { "key", "policyMap" })
@@ -69,20 +59,11 @@ import org.onap.policy.common.utils.validation.Assertions;
 public class AxPolicies extends AxConcept implements AxConceptGetter<AxPolicy> {
     private static final long serialVersionUID = 4290442590545820316L;
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     private AxArtifactKey key;
 
-    // @formatter:off
-    @ManyToMany(cascade = CascadeType.ALL)
-    @JoinTable(
-            joinColumns = {@JoinColumn(name = "policyMapName", referencedColumnName = "name"),
-                @JoinColumn(name = "policyMapVersion", referencedColumnName = "version")},
-            inverseJoinColumns = {@JoinColumn(name = "policyName", referencedColumnName = "name"),
-                @JoinColumn(name = "policyVersion", referencedColumnName = "version")})
     @XmlElement(required = true)
     private Map<AxArtifactKey, AxPolicy> policyMap;
-    // @formatter:on
 
     /**
      * The Default Constructor creates a {@link AxPolicies} object with a null artifact key and creates an empty event
index 4baba00..64785da 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020,2022 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,14 +27,6 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.OneToMany;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -79,8 +71,6 @@ import org.slf4j.ext.XLoggerFactory;
  * </ol>
  */
 
-@Entity
-@Table(name = "AxPolicy")
 @XmlRootElement(name = "apexPolicy", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AxPolicy", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
@@ -92,23 +82,15 @@ public class AxPolicy extends AxConcept {
     // Logger for this class
     private static final XLogger LOGGER = XLoggerFactory.getXLogger(AxPolicy.class);
 
-    @EmbeddedId
     @XmlElement(name = "policyKey", required = true)
     private AxArtifactKey key;
 
-    @Column(name = "template")
     @XmlElement(required = true)
     private String template;
 
-    // @formatter:off
-    @OneToMany(cascade = CascadeType.ALL)
-    @JoinTable(joinColumns = {@JoinColumn(name = "parentKeyName", referencedColumnName = "name"),
-        @JoinColumn(name = "parentKeyVersion", referencedColumnName = "version")})
     @XmlElement(name = "state", required = true)
     private Map<String, AxState> stateMap;
-    // @formatter:on
 
-    @Column(name = "firstState")
     @XmlElement(required = true)
     private String firstState;
 
index aec144a..38c08ed 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019,2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
  * ================================================================================
@@ -25,11 +25,6 @@ package org.onap.policy.apex.model.policymodel.concepts;
 
 import java.util.List;
 import java.util.Map.Entry;
-import javax.persistence.CascadeType;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
 import javax.xml.bind.Marshaller;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlAccessType;
@@ -103,9 +98,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * <li>All events referred to on direct state outputs must exist
  * </ol>
  */
-@Entity
-@Table(name = "AxPolicyModel")
-
 @XmlRootElement(name = "apexPolicyModel", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AxPolicyModel", namespace = "http://www.onap.org/policy/apex-pdp",
@@ -116,38 +108,21 @@ public class AxPolicyModel extends AxModel {
 
     private static final long serialVersionUID = 8800599637708309945L;
 
-    // @formatter:off
-    @OneToOne(cascade = CascadeType.ALL)
-    @JoinColumn(name = "policiesName", referencedColumnName = "name")
-    @JoinColumn(name = "policiesVersion", referencedColumnName = "version")
     @XmlElement(name = "policies", required = true)
     private AxPolicies policies;
 
-    @OneToOne(cascade = CascadeType.ALL)
-    @JoinColumn(name = "tasksName", referencedColumnName = "name")
-    @JoinColumn(name = "tasksVersion", referencedColumnName = "version")
     @XmlElement(name = "tasks", required = true)
     private AxTasks tasks;
 
-    @OneToOne(cascade = CascadeType.ALL)
-    @JoinColumn(name = "eventsName", referencedColumnName = "name")
-    @JoinColumn(name = "eventsVersion", referencedColumnName = "version")
     @XmlElement(name = "events", required = true)
     private AxEvents events;
 
-    @OneToOne(cascade = CascadeType.ALL)
-    @JoinColumn(name = "albumsName", referencedColumnName = "name")
-    @JoinColumn(name = "albumsVersion", referencedColumnName = "version")
     @XmlElement(name = "albums", required = false)
     @XmlJavaTypeAdapter(EmptyAlbumsAdapter.class)
     private AxContextAlbums albums;
 
-    @OneToOne(cascade = CascadeType.ALL)
-    @JoinColumn(name = "schemasName", referencedColumnName = "name")
-    @JoinColumn(name = "schemasVersion", referencedColumnName = "version")
     @XmlElement(name = "schemas", required = true)
     private AxContextSchemas schemas;
-    // @formatter:on
 
     /**
      * The Default Constructor creates a policy model with a null key and empty containers for
index 78a96a1..df07b0e 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
  *  Modifications Copyright (C) 2018 Samsung Electronics Co., Ltd.
- *  Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -29,19 +29,6 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
-import javax.persistence.AttributeOverride;
-import javax.persistence.CascadeType;
-import javax.persistence.CollectionTable;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Embedded;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -120,9 +107,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * </ol>
  */
 
-@Entity
-@Table(name = "AxState")
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexState", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxState", namespace = "http://www.onap.org/policy/apex-pdp", propOrder =
@@ -134,86 +118,29 @@ public class AxState extends AxConcept {
 
     private static final long serialVersionUID = 8041771382337655535L;
 
-    @EmbeddedId
     @XmlElement(name = "stateKey", required = true)
     private AxReferenceKey key;
 
-    // @formatter:off
-    @Embedded
-    @AttributeOverride(name = "name", column = @Column(name = "inTriggerName"))
-    @AttributeOverride(name = "version", column = @Column(name = "inTriggerVersion"))
-    @Column(name = "trigger")
     @XmlElement(required = true)
     private AxArtifactKey trigger;
 
-    @ManyToMany(cascade = CascadeType.ALL)
-    @JoinTable(
-            joinColumns = {@JoinColumn(name = "soParentKeyName", referencedColumnName = "parentKeyName"),
-                @JoinColumn(name = "soParentKeyVersion", referencedColumnName = "parentKeyVersion"),
-                @JoinColumn(name = "soParentLocalName", referencedColumnName = "parentLocalName"),
-                @JoinColumn(name = "soLocalName", referencedColumnName = "localName")},
-            inverseJoinColumns = {@JoinColumn(name = "stateParentKeyName", referencedColumnName = "parentKeyName"),
-                @JoinColumn(name = "stateParentKeyVersion", referencedColumnName = "parentKeyVersion"),
-                @JoinColumn(name = "stateParentLocalName", referencedColumnName = "parentLocalName"),
-                @JoinColumn(name = "stateLocalName", referencedColumnName = "localName")})
     @XmlElement(name = "stateOutputs", required = true)
     private Map<String, AxStateOutput> stateOutputs;
 
-    @ElementCollection
-    @CollectionTable(joinColumns = {@JoinColumn(name = "stateParentKeyName", referencedColumnName = "parentKeyName"),
-        @JoinColumn(name = "stateParentKeyVersion", referencedColumnName = "parentKeyVersion"),
-        @JoinColumn(name = "stateParentLocalName", referencedColumnName = "parentLocalName"),
-        @JoinColumn(name = "stateLocalName", referencedColumnName = "localName")})
     @XmlElement(name = "contextAlbumReference")
     private Set<AxArtifactKey> contextAlbumReferenceSet;
 
-    @OneToOne
-    @JoinTable(name = "STATE_TSL_JT",
-            joinColumns = {
-                @JoinColumn(name = "tslParentKeyName", referencedColumnName = "parentKeyName", updatable = false,
-                            insertable = false),
-                @JoinColumn(name = "tslParentKeyVersion", referencedColumnName = "parentKeyVersion",
-                            updatable = false, insertable = false),
-                @JoinColumn(name = "tslParentLocalName ", referencedColumnName = "parentLocalName",
-                            updatable = false, insertable = false),
-                @JoinColumn(name = "tslLocalName", referencedColumnName = "localName", updatable = false,
-                            insertable = false)})
     @XmlElement(required = true)
     private AxTaskSelectionLogic taskSelectionLogic;
 
-    @ManyToMany(cascade = CascadeType.ALL)
-    @JoinTable(
-            joinColumns = {@JoinColumn(name = "sflParentKeyName", referencedColumnName = "parentKeyName"),
-                @JoinColumn(name = "sflParentKeyVersion", referencedColumnName = "parentKeyVersion"),
-                @JoinColumn(name = "sflParentLocalName", referencedColumnName = "parentLocalName"),
-                @JoinColumn(name = "sflLocalName", referencedColumnName = "localName")},
-            inverseJoinColumns = {@JoinColumn(name = "stateParentKeyName", referencedColumnName = "parentKeyName"),
-                @JoinColumn(name = "stateParentKeyVersion", referencedColumnName = "parentKeyVersion"),
-                @JoinColumn(name = "stateParentLocalName", referencedColumnName = "parentLocalName"),
-                @JoinColumn(name = "stateLocalName", referencedColumnName = "localName")})
     @XmlElement(name = "stateFinalizerLogicMap", required = true)
     private Map<String, AxStateFinalizerLogic> stateFinalizerLogicMap;
 
-    @Embedded
-    @AttributeOverride(name = "name", column = @Column(name = "defaultTaskName"))
-    @AttributeOverride(name = "version", column = @Column(name = "defaultTaskVersion"))
-    @Column(name = "defaultTask")
     @XmlElement(required = true)
     private AxArtifactKey defaultTask;
 
-    @ManyToMany(cascade = CascadeType.ALL)
-    @JoinTable(
-            joinColumns = {@JoinColumn(name = "trmParentKeyName", referencedColumnName = "parentKeyName"),
-                @JoinColumn(name = "trmParentKeyVersion", referencedColumnName = "parentKeyVersion"),
-                @JoinColumn(name = "trmParentLocalName", referencedColumnName = "parentLocalName"),
-                @JoinColumn(name = "trmLocalName", referencedColumnName = "localName")},
-            inverseJoinColumns = {@JoinColumn(name = "stateParentKeyName", referencedColumnName = "parentKeyName"),
-                @JoinColumn(name = "stateParentKeyVersion", referencedColumnName = "parentKeyVersion"),
-                @JoinColumn(name = "stateParentLocalName", referencedColumnName = "parentLocalName"),
-                @JoinColumn(name = "stateLocalName", referencedColumnName = "localName")})
     @XmlElement(name = "taskReferences", required = true)
     private Map<AxArtifactKey, AxStateTaskReference> taskReferenceMap;
-    // @formatter:on
 
     /**
      * The Default Constructor creates a state with a null reference key and with default values for all other fields.
index 0b5d975..51ec51a 100644 (file)
@@ -1,29 +1,26 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2022 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.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
 
 package org.onap.policy.apex.model.policymodel.concepts;
 
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -33,19 +30,15 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
 /**
  * This class holds State Finalizer Logic for {@link AxState} states in Apex. It is a specialization
  * of the {@link AxLogic} class, so that State Finalizer Logic in Apex states can be strongly typed.
- * 
+ *
  * <p>State Finalizer Logic is used to select the output {@link AxStateOutput} that a state will use.
  * The logic uses fields emitted by the executed {@link AxTask} task and information from the
  * context albums available on a state to decide what state output {@link AxStateOutput} to select
  * in a given context. State Finalizer Logic must marshal the output fields from the task onto the
  * output event in whatever manner is appropriate for the domain being handled.
- * 
+ *
  * <p>Validation uses standard Apex Logic validation, see validation in {@link AxLogic}.
  */
-@Entity
-@Table(name = "AxStateFinalizerLogic")
-@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexStateFinalizerLogic", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxStateFinalizerLogic", namespace = "http://www.onap.org/policy/apex-pdp")
index 59433dc..b90f2c8 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019,2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  *  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
  * ================================================================================
@@ -25,15 +25,6 @@ package org.onap.policy.apex.model.policymodel.concepts;
 
 import java.util.List;
 import java.util.Set;
-import javax.persistence.AttributeOverride;
-import javax.persistence.CollectionTable;
-import javax.persistence.Column;
-import javax.persistence.ElementCollection;
-import javax.persistence.Embedded;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -70,9 +61,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * </ol>
  */
 
-@Entity
-@Table(name = "AxStateOutput")
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexStateOutput", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxStateOutput", namespace = "http://www.onap.org/policy/apex-pdp",
@@ -82,34 +70,17 @@ import org.onap.policy.common.utils.validation.Assertions;
 public class AxStateOutput extends AxConcept {
     private static final long serialVersionUID = 8041771382337655535L;
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     @NonNull
     private AxReferenceKey key;
 
-    // @formatter:off
-    @Embedded
-    @AttributeOverride(name = "name", column = @Column(name = "outgoingEventName"))
-    @AttributeOverride(name = "version", column = @Column(name = "outgoingEventVersion"))
-    @Column(name = "outgoingEvent")
     @XmlElement(required = true)
     @NonNull
     private AxArtifactKey outgoingEvent;
 
-    @ElementCollection
-    @CollectionTable(joinColumns = {@JoinColumn(name = "stateParentKeyName", referencedColumnName = "parentKeyName"),
-        @JoinColumn(name = "stateParentKeyVersion", referencedColumnName = "parentKeyVersion"),
-        @JoinColumn(name = "stateParentLocalName", referencedColumnName = "parentLocalName"),
-        @JoinColumn(name = "stateLocalName", referencedColumnName = "localName")})
     @XmlElement(name = "outgoingEventReference", required = false)
     private Set<AxArtifactKey> outgoingEventSet;
 
-    @Embedded
-    @AttributeOverride(name = "parentKeyName", column = @Column(name = "nextStateParentKeyName"))
-    @AttributeOverride(name = "parentKeyVersion", column = @Column(name = "nextStateParentKeyVersion"))
-    @AttributeOverride(name = "parentLocalName", column = @Column(name = "nextStateParentLocalName"))
-    @AttributeOverride(name = "localName", column = @Column(name = "nextStateLocalName"))
-    @Column(name = "nextState")
     @XmlElement(required = true)
     @NonNull
     private AxReferenceKey nextState;
index c98e38f..711e184 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019,2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
 package org.onap.policy.apex.model.policymodel.concepts;
 
 import java.util.List;
-import javax.persistence.AttributeOverride;
-import javax.persistence.Column;
-import javax.persistence.Embedded;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Enumerated;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -69,9 +62,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * </ol>
  */
 
-@Entity
-@Table(name = "AxStateTaskReference")
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexStateTaskReference", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxStateTaskReference", namespace = "http://www.onap.org/policy/apex-pdp",
@@ -80,25 +70,14 @@ import org.onap.policy.common.utils.validation.Assertions;
 public class AxStateTaskReference extends AxConcept {
     private static final long serialVersionUID = 8041771382337655535L;
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     private AxReferenceKey key;
 
-    @Enumerated
-    @Column(name = "outputType")
     @XmlElement(required = true)
     private AxStateTaskOutputType outputType;
 
-    // @formatter:off
-    @Embedded
-    @AttributeOverride(name = "parentKeyName", column = @Column(name = "outputParentKeyName"))
-    @AttributeOverride(name = "parentKeyVersion", column = @Column(name = "outputParentKeyVersion"))
-    @AttributeOverride(name = "parentLocalName", column = @Column(name = "outputParentLocalName"))
-    @AttributeOverride(name = "localName", column = @Column(name = "outputLocalName"))
-    @Column(name = "output")
     @XmlElement(required = true)
     private AxReferenceKey output;
-    // @formatter:on
 
     /**
      * The Default Constructor creates a state task reference with a null reference key, an
index 7eba99a..3911a1f 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2021 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,16 +28,6 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.TreeSet;
-import javax.persistence.CascadeType;
-import javax.persistence.CollectionTable;
-import javax.persistence.ElementCollection;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.OneToMany;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -82,9 +72,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * </ol>
  */
 
-@Entity
-@Table(name = "AxTask")
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexTask", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(
@@ -99,41 +86,23 @@ public class AxTask extends AxConcept {
 
     private static final long serialVersionUID = 5374237330697362762L;
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     @NonNull
     private AxArtifactKey key;
 
-    @OneToOne(cascade = CascadeType.ALL)
-    @JoinTable(
-        name = "INPUT_EVENT_JT",
-        joinColumns = {@JoinColumn(name = "inEventTaskName", referencedColumnName = "name", updatable = false),
-            @JoinColumn(name = "inEventTaskVersion", referencedColumnName = "version", updatable = false)})
     @XmlElement(name = "inputEvent", required = false)
     private AxEvent inputEvent;
 
-    @OneToMany(cascade = CascadeType.ALL)
-    @JoinTable(
-        name = "OUTPUT_EVENT_JT",
-        joinColumns = {@JoinColumn(name = "outEventTaskName", referencedColumnName = "name", updatable = false),
-            @JoinColumn(name = "outEventTaskVersion", referencedColumnName = "version", updatable = false)})
     @XmlElement(name = "outputEvents", required = false)
     private Map<String, AxEvent> outputEvents;
 
-    @OneToMany(cascade = CascadeType.ALL)
     @XmlElement(name = "taskParameters", required = true)
     private Map<String, AxTaskParameter> taskParameters;
 
-    // @formatter:off
-    @ElementCollection
-    @CollectionTable(joinColumns = {@JoinColumn(name = "contextAlbumName", referencedColumnName = "name"),
-        @JoinColumn(name = "contextAlbumVersion", referencedColumnName = "version")})
     @XmlElement(name = "contextAlbumReference")
     @NonNull
     private Set<AxArtifactKey> contextAlbumReferenceSet;
-    // @formatter:on
 
-    @OneToOne(cascade = CascadeType.ALL)
     @XmlElement(required = true)
     @NonNull
     private AxTaskLogic taskLogic;
index 70b19ec..38c0d6d 100644 (file)
@@ -1,29 +1,26 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2022 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.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
 
 package org.onap.policy.apex.model.policymodel.concepts;
 
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -34,17 +31,13 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
 /**
  * This class holds Task Logic for {@link AxTask} tasks in Apex. It is a specialization of the
  * {@link AxLogic} class, so that Task Logic in Apex states can be strongly typed.
- * 
+ *
  * <p>Task Logic is used to execute tasks {@link AxTask} in Apex. The logic uses fields on the incoming
  * trigger event and information from the context albums available on a task to get context during
  * execution. The task logic populates the output fields of the task.
- * 
+ *
  * <p>Validation uses standard Apex Logic validation, see validation in {@link AxLogic}.
  */
-@Entity
-@Table(name = "AxTaskLogic")
-@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexLogic", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxTaskLogic", namespace = "http://www.onap.org/policy/apex-pdp")
index 47c62e6..7cb052a 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019,2022 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 package org.onap.policy.apex.model.policymodel.concepts;
 
 import java.util.List;
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlElement;
@@ -47,9 +43,6 @@ import org.onap.policy.common.utils.validation.Assertions;
  * default value.
  */
 
-@Entity
-@Table(name = "AxTaskParameter")
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexTaskParameter", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxTaskParameter", namespace = "http://www.onap.org/policy/apex-pdp",
@@ -58,11 +51,9 @@ import org.onap.policy.common.utils.validation.Assertions;
 public class AxTaskParameter extends AxConcept {
     private static final long serialVersionUID = 7351688156934099977L;
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     private AxReferenceKey key;
 
-    @Column(name = "defaultValue")
     @XmlElement
     private String defaultValue;
 
index 5d6441a..43b8f11 100644 (file)
@@ -1,29 +1,26 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
+ *  Modifications Copyright (C) 2022 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.
  * See the License for the specific language governing permissions and
  * limitations under the License.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
 
 package org.onap.policy.apex.model.policymodel.concepts;
 
-import javax.persistence.Entity;
-import javax.persistence.Inheritance;
-import javax.persistence.InheritanceType;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
@@ -33,17 +30,13 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey;
 /**
  * This class holds Task Selection Logic for {@link AxState} states in Apex. It is a specialization
  * of the {@link AxLogic} class, so that Task Selection Logic in Apex states can be strongly typed.
- * 
+ *
  * <p>Task Selection Logic is used to select the task {@link AxTask} that a state will execute. The
  * logic uses fields on the incoming trigger event and information from the context albums available
  * on a state to decide what task {@link AxTask} to select for execution in a given context.
- * 
+ *
  * <p>Validation uses standard Apex Logic validation, see validation in {@link AxLogic}.
  */
-@Entity
-@Table(name = "AxTaskSelectionLogic")
-@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlRootElement(name = "apexTaskSelectionLogic", namespace = "http://www.onap.org/policy/apex-pdp")
 @XmlType(name = "AxTaskSelectionLogic", namespace = "http://www.onap.org/policy/apex-pdp")
index 73012d8..bae50e0 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019-2020 Nordix Foundation.
+ *  Modifications Copyright (C) 2019-2020,2022 Nordix Foundation.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -27,13 +27,6 @@ import java.util.Map.Entry;
 import java.util.NavigableMap;
 import java.util.Set;
 import java.util.TreeMap;
-import javax.persistence.CascadeType;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.JoinColumn;
-import javax.persistence.JoinTable;
-import javax.persistence.ManyToMany;
-import javax.persistence.Table;
 import javax.xml.bind.Unmarshaller;
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -59,28 +52,16 @@ import org.onap.policy.common.utils.validation.Assertions;
  * in the container. Each task entry is checked to ensure that its key and value are not null and
  * that the key matches the key in the map value. Each task entry is then validated individually.
  */
-@Entity
-@Table(name = "AxTasks")
-
 @XmlAccessorType(XmlAccessType.FIELD)
 @XmlType(name = "AxTasks", namespace = "http://www.onap.org/policy/apex-pdp", propOrder = {"key", "taskMap"})
 public class AxTasks extends AxConcept implements AxConceptGetter<AxTask> {
     private static final long serialVersionUID = 4290442590545820316L;
 
-    @EmbeddedId
     @XmlElement(name = "key", required = true)
     private AxArtifactKey key;
 
-    // @formatter:off
-    @ManyToMany(cascade = CascadeType.ALL)
-    @JoinTable(
-            joinColumns = {@JoinColumn(name = "taskMapName", referencedColumnName = "name"),
-                @JoinColumn(name = "taskMapVersion", referencedColumnName = "version")},
-            inverseJoinColumns = {@JoinColumn(name = "taskName", referencedColumnName = "name"),
-                @JoinColumn(name = "taskVersion", referencedColumnName = "version")})
     @XmlElement(required = true)
     private Map<AxArtifactKey, AxTask> taskMap;
-    // @formatter:on
 
     /**
      * The Default Constructor creates a {@link AxTasks} object with a null artifact key and creates
index 5004054..ca3c057 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019,2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,9 +24,6 @@ package org.onap.policy.apex.testsuites.integration.context.entities;
 
 import java.util.Arrays;
 import java.util.List;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlElement;
 import lombok.AllArgsConstructor;
 import lombok.EqualsAndHashCode;
@@ -42,8 +39,6 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
 /**
  * The Class ArtifactKeyTestEntity is an entity for testing artifact keys.
  */
-@Entity
-@Table(name = "ArtifactKeyTestEntity")
 @Getter
 @Setter
 @ToString
@@ -52,7 +47,6 @@ import org.onap.policy.apex.model.basicmodel.concepts.AxValidationResult;
 public class ArtifactKeyTestEntity extends AxConcept {
     private static final long serialVersionUID = -2962570563281067896L;
 
-    @EmbeddedId()
     @XmlElement(name = "key", required = true)
     protected AxArtifactKey key;
 
index a8b90d1..8492ca8 100644 (file)
@@ -1,7 +1,7 @@
 /*-
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2016-2018 Ericsson. All rights reserved.
- *  Modifications Copyright (C) 2019 Nordix Foundation.
+ *  Modifications Copyright (C) 2019,2022 Nordix Foundation.
  *  Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,9 +24,6 @@ package org.onap.policy.apex.testsuites.integration.context.entities;
 
 import java.util.Arrays;
 import java.util.List;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 import lombok.AllArgsConstructor;
@@ -44,8 +41,6 @@ import org.onap.policy.apex.model.basicmodel.xml.AxReferenceKeyAdapter;
 /**
  * The Class ReferenceKeyTestEntity provides a reference key test concept.
  */
-@Entity
-@Table(name = "ReferenceKeyTestEntity")
 @Getter
 @Setter
 @ToString
@@ -54,7 +49,6 @@ import org.onap.policy.apex.model.basicmodel.xml.AxReferenceKeyAdapter;
 public class ReferenceKeyTestEntity extends AxConcept {
     private static final long serialVersionUID = -2962570563281067895L;
 
-    @EmbeddedId()
     @XmlElement(name = "key", required = true)
     @XmlJavaTypeAdapter(AxReferenceKeyAdapter.class)
     protected AxReferenceKey key;