aboutsummaryrefslogtreecommitdiffstats
path: root/mso-catalog-db/src/main/java/org
diff options
context:
space:
mode:
authorUbuntu <sunshine.wang@huawei.com>2019-12-13 12:05:20 +0800
committerUbuntu <sunshine.wang@huawei.com>2019-12-13 12:09:18 +0800
commit2ce8c8e9e450ec1b885823c8dd3d985eaac260ac (patch)
treed3ffbfbe79d1bbc0b79e8432c358b4fd9a185234 /mso-catalog-db/src/main/java/org
parent02c068ce771ee4522936f2d15f41c2b631e965a8 (diff)
add pnf_resource_to_workflow to catalogdb
bind the pnf model uuid to pnf workflow Issue-ID: SO-2558 Signed-off-by: Yaoguang Wang <sunshine.wang@huawei.com> Change-Id: I779ba8bef8ca3bb67ab6e9245eafec8b84571c85
Diffstat (limited to 'mso-catalog-db/src/main/java/org')
-rw-r--r--mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceWorkflow.java91
1 files changed, 91 insertions, 0 deletions
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceWorkflow.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceWorkflow.java
new file mode 100644
index 0000000000..6e48938f19
--- /dev/null
+++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceWorkflow.java
@@ -0,0 +1,91 @@
+package org.onap.so.db.catalog.beans;
+
+import java.io.Serializable;
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import com.openpojo.business.annotation.BusinessKey;
+import uk.co.blackpepper.bowman.annotation.LinkedResource;
+
+@Entity
+@Table(name = "pnf_resource_to_workflow")
+public class PnfResourceWorkflow implements Serializable {
+
+ private static final long serialVersionUID = 4897166645148426088L;
+
+ @Id
+ @Column(name = "ID", nullable = false, updatable = false)
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ private Integer ID;
+
+ @BusinessKey
+ @Column(name = "PNF_RESOURCE_MODEL_UUID")
+ private String pnfResourceModelUUID;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "PNF_RESOURCE_MODEL_UUID", updatable = false, insertable = false)
+ private PnfResource pnfResource;
+
+ @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinColumn(name = "WORKFLOW_ID")
+ private Workflow workflow;
+
+ @Override
+ public String toString() {
+ return new ToStringBuilder(this).append("pnfResourceModelUUID", pnfResourceModelUUID).toString();
+ }
+
+ @Override
+ public boolean equals(final Object other) {
+ if (!(other instanceof PnfResourceWorkflow)) {
+ return false;
+ }
+ PnfResourceWorkflow castOther = (PnfResourceWorkflow) other;
+ return new EqualsBuilder().append(pnfResourceModelUUID, castOther.pnfResourceModelUUID).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(pnfResourceModelUUID).toHashCode();
+ }
+
+ public Integer getID() {
+ return ID;
+ }
+
+ public String getPnfResourceModelUUID() {
+ return pnfResourceModelUUID;
+ }
+
+ public void setPnfResourceModelUUID(String pnfResourceModelUUID) {
+ this.pnfResourceModelUUID = pnfResourceModelUUID;
+ }
+
+ @LinkedResource
+ public PnfResource getPnfResource() {
+ return pnfResource;
+ }
+
+ public void setPnfResource(PnfResource pnfResource) {
+ this.pnfResource = pnfResource;
+ }
+
+ @LinkedResource
+ public Workflow getWorkflow() {
+ return workflow;
+ }
+
+ public void setWorkflow(Workflow workflow) {
+ this.workflow = workflow;
+ }
+}