diff options
author | Chuanyu Chen <chenchuanyu@huawei.com> | 2019-12-18 06:06:32 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-12-18 06:06:32 +0000 |
commit | 145eb372a14a2dd25f75033acd37e269c33caf95 (patch) | |
tree | c4dd325c182d3d9c3d4d7678dcc298ee44624ee2 /mso-catalog-db/src/main | |
parent | ef4e7b50f4dc76ca042ddda76cdcf4e5ed10d9f4 (diff) | |
parent | 2ce8c8e9e450ec1b885823c8dd3d985eaac260ac (diff) |
Merge "add pnf_resource_to_workflow to catalogdb bind the pnf model uuid to pnf workflow"
Diffstat (limited to 'mso-catalog-db/src/main')
-rw-r--r-- | mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceWorkflow.java | 91 |
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; + } +} |