diff options
Diffstat (limited to 'mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java')
-rw-r--r-- | mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java | 382 |
1 files changed, 189 insertions, 193 deletions
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java index 4ec2a92a73..29f8bcece5 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModuleCustomization.java @@ -25,7 +25,6 @@ import java.util.Date; import java.util.HashSet; import java.util.List; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -39,208 +38,205 @@ import javax.persistence.PrePersist; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; - import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.onap.so.db.catalog.beans.macro.OrchestrationFlow; - import com.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "vf_module_customization") public class VfModuleCustomization implements Serializable { - public static final long serialVersionUID = -1322322139926390329L; - - @Id - @BusinessKey - @Column(name = "ID") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "LABEL") - private String label; - - @Column(name = "MIN_INSTANCES") - private Integer minInstances; - - @Column(name = "MAX_INSTANCES") - private Integer maxInstances; - - @Column(name = "INITIAL_COUNT") - private Integer initialCount; - - @Column(name = "AVAILABILITY_ZONE_COUNT") - private Integer availabilityZoneCount; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @ManyToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "VOL_ENVIRONMENT_ARTIFACT_UUID") - HeatEnvironment volumeHeatEnv; - - @ManyToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "HEAT_ENVIRONMENT_ARTIFACT_UUID") - HeatEnvironment heatEnvironment; - - @ManyToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "VF_MODULE_MODEL_UUID") - private VfModule vfModule; - - @ManyToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "VNF_RESOURCE_CUSTOMIZATION_ID") - private VnfResourceCustomization vnfCustomization; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "vfModuleCustomization") - private Set<CvnfcCustomization> cvnfcCustomization; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VfModuleCustomization)) { - return false; - } - VfModuleCustomization castOther = (VfModuleCustomization) other; - return new EqualsBuilder().append(id, castOther.id).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(id).toHashCode(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID).append("label", label) - .append("minInstances", minInstances).append("maxInstances", maxInstances) - .append("initialCount", initialCount).append("availabilityZoneCount", availabilityZoneCount) - .append("created", created).append("volumeHeatEnv", volumeHeatEnv) - .append("heatEnvironment", heatEnvironment).append("vfModule", vfModule).toString(); - } - - - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public VnfResourceCustomization getVnfCustomization() { - return vnfCustomization; - } - - public void setVnfCustomization(VnfResourceCustomization vnfCustomization) { - this.vnfCustomization = vnfCustomization; - } - - public VfModuleCustomization() { - super(); - } - - public String getModelCustomizationUUID() { - return this.modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - @LinkedResource - public HeatEnvironment getVolumeHeatEnv() { - return volumeHeatEnv; - } - - public void setVolumeHeatEnv(HeatEnvironment volumeHeatEnv) { - this.volumeHeatEnv = volumeHeatEnv; - } - - @LinkedResource - public HeatEnvironment getHeatEnvironment() { - return heatEnvironment; - } - - public void setHeatEnvironment(HeatEnvironment heatEnvironment) { - this.heatEnvironment = heatEnvironment; - } - - public Integer getMinInstances() { - return this.minInstances; - } - - public void setMinInstances(Integer minInstances) { - this.minInstances = minInstances; - } - - public Integer getMaxInstances() { - return this.maxInstances; - } - - public void setMaxInstances(Integer maxInstances) { - this.maxInstances = maxInstances; - } - - public Integer getInitialCount() { - return this.initialCount; - } - - public void setInitialCount(Integer initialCount) { - this.initialCount = initialCount; - } - - public Integer getAvailabilityZoneCount() { - return this.availabilityZoneCount; - } - - public void setAvailabilityZoneCount(Integer availabilityZoneCount) { - this.availabilityZoneCount = availabilityZoneCount; - } - - public Date getCreated() { - return created; - } - - public String getLabel() { - return this.label; - } - - public void setLabel(String label) { - this.label = label; - } - - @LinkedResource - public VfModule getVfModule() { - return this.vfModule; - } - - public void setVfModule(VfModule vfModule) { - this.vfModule = vfModule; - } - - @LinkedResource - public Set<CvnfcCustomization> getCvnfcCustomization() { - if (cvnfcCustomization == null) - cvnfcCustomization = new HashSet<>(); - return cvnfcCustomization; - } - - public void setCvnfcCustomization(Set<CvnfcCustomization> cvnfcCustomization) { - this.cvnfcCustomization = cvnfcCustomization; - } + public static final long serialVersionUID = -1322322139926390329L; + + @Id + @BusinessKey + @Column(name = "ID") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "LABEL") + private String label; + + @Column(name = "MIN_INSTANCES") + private Integer minInstances; + + @Column(name = "MAX_INSTANCES") + private Integer maxInstances; + + @Column(name = "INITIAL_COUNT") + private Integer initialCount; + + @Column(name = "AVAILABILITY_ZONE_COUNT") + private Integer availabilityZoneCount; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @ManyToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "VOL_ENVIRONMENT_ARTIFACT_UUID") + HeatEnvironment volumeHeatEnv; + + @ManyToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "HEAT_ENVIRONMENT_ARTIFACT_UUID") + HeatEnvironment heatEnvironment; + + @ManyToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "VF_MODULE_MODEL_UUID") + private VfModule vfModule; + + @ManyToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "VNF_RESOURCE_CUSTOMIZATION_ID") + private VnfResourceCustomization vnfCustomization; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "vfModuleCustomization") + private Set<CvnfcCustomization> cvnfcCustomization; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VfModuleCustomization)) { + return false; + } + VfModuleCustomization castOther = (VfModuleCustomization) other; + return new EqualsBuilder().append(id, castOther.id).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(id).toHashCode(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID).append("label", label) + .append("minInstances", minInstances).append("maxInstances", maxInstances) + .append("initialCount", initialCount).append("availabilityZoneCount", availabilityZoneCount) + .append("created", created).append("volumeHeatEnv", volumeHeatEnv) + .append("heatEnvironment", heatEnvironment).append("vfModule", vfModule).toString(); + } + + + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public VnfResourceCustomization getVnfCustomization() { + return vnfCustomization; + } + + public void setVnfCustomization(VnfResourceCustomization vnfCustomization) { + this.vnfCustomization = vnfCustomization; + } + + public VfModuleCustomization() { + super(); + } + + public String getModelCustomizationUUID() { + return this.modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + @LinkedResource + public HeatEnvironment getVolumeHeatEnv() { + return volumeHeatEnv; + } + + public void setVolumeHeatEnv(HeatEnvironment volumeHeatEnv) { + this.volumeHeatEnv = volumeHeatEnv; + } + + @LinkedResource + public HeatEnvironment getHeatEnvironment() { + return heatEnvironment; + } + + public void setHeatEnvironment(HeatEnvironment heatEnvironment) { + this.heatEnvironment = heatEnvironment; + } + + public Integer getMinInstances() { + return this.minInstances; + } + + public void setMinInstances(Integer minInstances) { + this.minInstances = minInstances; + } + + public Integer getMaxInstances() { + return this.maxInstances; + } + + public void setMaxInstances(Integer maxInstances) { + this.maxInstances = maxInstances; + } + + public Integer getInitialCount() { + return this.initialCount; + } + + public void setInitialCount(Integer initialCount) { + this.initialCount = initialCount; + } + + public Integer getAvailabilityZoneCount() { + return this.availabilityZoneCount; + } + + public void setAvailabilityZoneCount(Integer availabilityZoneCount) { + this.availabilityZoneCount = availabilityZoneCount; + } + + public Date getCreated() { + return created; + } + + public String getLabel() { + return this.label; + } + + public void setLabel(String label) { + this.label = label; + } + + @LinkedResource + public VfModule getVfModule() { + return this.vfModule; + } + + public void setVfModule(VfModule vfModule) { + this.vfModule = vfModule; + } + + @LinkedResource + public Set<CvnfcCustomization> getCvnfcCustomization() { + if (cvnfcCustomization == null) + cvnfcCustomization = new HashSet<>(); + return cvnfcCustomization; + } + + public void setCvnfcCustomization(Set<CvnfcCustomization> cvnfcCustomization) { + this.cvnfcCustomization = cvnfcCustomization; + } } |