diff options
Diffstat (limited to 'mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans')
78 files changed, 7343 insertions, 7549 deletions
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpec.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpec.java index 9fcb1824db..00eff8f0c9 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpec.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpec.java @@ -4,7 +4,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -19,13 +18,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import org.hibernate.annotations.NotFound; import org.hibernate.annotations.NotFoundAction; import uk.co.blackpepper.bowman.annotation.LinkedResource; @@ -34,142 +30,141 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "ACTIVITY_SPEC") public class ActivitySpec implements Serializable { - private static final long serialVersionUID = 6902290480087262973L; - - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer ID; - - @BusinessKey - @Column(name = "NAME") - private String name; - - @Column(name = "DESCRIPTION") - private String description; - - @BusinessKey - @Column(name = "VERSION") - private Double version; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpec") - private List<WorkflowActivitySpecSequence> workflowActivitySpecSequence; - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpec") - private List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories; - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpec") - private List<ActivitySpecUserParameters> activitySpecUserParameters; - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpec") - private List<ActivitySpecActivitySpecParameters> activitySpecActivitySpecParameters; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public Integer getID() { - return ID; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - public Double getVersion() { - return version; - } - - public void setVersion(Double version) { - this.version = version; - } - - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } - - @LinkedResource - public List<WorkflowActivitySpecSequence> getWorkflowActivitySpecSequence() { - return workflowActivitySpecSequence; - } - - public void setWorkflowActivitySpecSequence( - List<WorkflowActivitySpecSequence> workflowActivitySpecSequence) { - this.workflowActivitySpecSequence = workflowActivitySpecSequence; - } - - @LinkedResource - public List<ActivitySpecUserParameters> getActivitySpecUserParameters() { - return activitySpecUserParameters; - } - - public void setActivitySpecUserParameters( - List<ActivitySpecUserParameters> activitySpecUserParameters) { - this.activitySpecUserParameters = activitySpecUserParameters; - } - - @LinkedResource - public List<ActivitySpecActivitySpecCategories> getActivitySpecActivitySpecCategories() { - return activitySpecActivitySpecCategories; - } - - public void setActivitySpecActivitySpecCategories( - List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories) { - this.activitySpecActivitySpecCategories = activitySpecActivitySpecCategories; - } - - @LinkedResource - public List<ActivitySpecActivitySpecParameters> getActivitySpecActivitySpecParameters() { - return activitySpecActivitySpecParameters; - } - - public void setActivitySpecActivitySpecParameters( - List<ActivitySpecActivitySpecParameters> activitySpecActivitySpecParameters) { - this.activitySpecActivitySpecParameters = activitySpecActivitySpecParameters; - } - - - - @Override - public String toString() { - return new ToStringBuilder(this).append("name", name) - .append("description", description).append("version", version) - .append("created", created).append("workflowActivitySpecSequence", workflowActivitySpecSequence) - .append("activitySpecActivitySpecCategories", activitySpecActivitySpecCategories).toString(); - } - @Override - public boolean equals(final Object other) { - if (!(other instanceof ActivitySpec)) { - return false; - } - ActivitySpec castOther = (ActivitySpec) other; - return new EqualsBuilder().append(name, castOther.name).append(version, castOther.version).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(name).append(version).toHashCode(); - } + private static final long serialVersionUID = 6902290480087262973L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer ID; + + @BusinessKey + @Column(name = "NAME") + private String name; + + @Column(name = "DESCRIPTION") + private String description; + + @BusinessKey + @Column(name = "VERSION") + private Double version; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpec") + private List<WorkflowActivitySpecSequence> workflowActivitySpecSequence; + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpec") + private List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories; + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpec") + private List<ActivitySpecUserParameters> activitySpecUserParameters; + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpec") + private List<ActivitySpecActivitySpecParameters> activitySpecActivitySpecParameters; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public Integer getID() { + return ID; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + public Double getVersion() { + return version; + } + + public void setVersion(Double version) { + this.version = version; + } + + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } + + @LinkedResource + public List<WorkflowActivitySpecSequence> getWorkflowActivitySpecSequence() { + return workflowActivitySpecSequence; + } + + public void setWorkflowActivitySpecSequence(List<WorkflowActivitySpecSequence> workflowActivitySpecSequence) { + this.workflowActivitySpecSequence = workflowActivitySpecSequence; + } + + @LinkedResource + public List<ActivitySpecUserParameters> getActivitySpecUserParameters() { + return activitySpecUserParameters; + } + + public void setActivitySpecUserParameters(List<ActivitySpecUserParameters> activitySpecUserParameters) { + this.activitySpecUserParameters = activitySpecUserParameters; + } + + @LinkedResource + public List<ActivitySpecActivitySpecCategories> getActivitySpecActivitySpecCategories() { + return activitySpecActivitySpecCategories; + } + + public void setActivitySpecActivitySpecCategories( + List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories) { + this.activitySpecActivitySpecCategories = activitySpecActivitySpecCategories; + } + + @LinkedResource + public List<ActivitySpecActivitySpecParameters> getActivitySpecActivitySpecParameters() { + return activitySpecActivitySpecParameters; + } + + public void setActivitySpecActivitySpecParameters( + List<ActivitySpecActivitySpecParameters> activitySpecActivitySpecParameters) { + this.activitySpecActivitySpecParameters = activitySpecActivitySpecParameters; + } + + + + @Override + public String toString() { + return new ToStringBuilder(this).append("name", name).append("description", description) + .append("version", version).append("created", created) + .append("workflowActivitySpecSequence", workflowActivitySpecSequence) + .append("activitySpecActivitySpecCategories", activitySpecActivitySpecCategories).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ActivitySpec)) { + return false; + } + ActivitySpec castOther = (ActivitySpec) other; + return new EqualsBuilder().append(name, castOther.name).append(version, castOther.version).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(name).append(version).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategories.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategories.java index e18188dff8..3518805b0d 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategories.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategories.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -37,13 +36,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @@ -51,88 +47,86 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "activity_spec_to_activity_spec_categories") public class ActivitySpecActivitySpecCategories implements Serializable { - private static final long serialVersionUID = 6228647901909437418L; - - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer ID; - - @BusinessKey - @Id - @Column(name = "ACTIVITY_SPEC_ID") - private Integer activitySpecId; - - @BusinessKey - @Id - @Column(name = "ACTIVITY_SPEC_CATEGORIES_ID") - private Integer activitySpecCategoriesId; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false) - private ActivitySpec activitySpec; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "ACTIVITY_SPEC_CATEGORIES_ID", updatable = false, insertable = false) - private ActivitySpecCategories activitySpecCategories; - - @Override - public String toString() { - return new ToStringBuilder(this) - .append("activitySpecId", activitySpecId) - .append("activitySpecCategoriesId", activitySpecCategoriesId) - .toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ActivitySpecActivitySpecCategories)) { - return false; - } - ActivitySpecActivitySpecCategories castOther = (ActivitySpecActivitySpecCategories) other; - return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) - .append(activitySpecCategoriesId, castOther.activitySpecCategoriesId).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(activitySpecId).append(activitySpecCategoriesId).toHashCode(); - } - - public Integer getID() { - return ID; - } - - public Integer getActivitySpecId() { - return activitySpecId; - } - - public void setActivitySpecId(Integer activitySpecId) { - this.activitySpecId = activitySpecId; - } - - public Integer getActivitySpecCategoriesId() { - return activitySpecCategoriesId; - } - - public void setActivitySpecCategoriesId(Integer activitySpecCategoriesId) { - this.activitySpecCategoriesId = activitySpecCategoriesId; - } - - public ActivitySpec getActivitySpec() { - return activitySpec; - } - - public void setActivitySpec(ActivitySpec activitySpec) { - this.activitySpec = activitySpec; - } - - public ActivitySpecCategories getActivitySpecCategories() { - return activitySpecCategories; - } - - public void setActivitySpecCategories(ActivitySpecCategories activitySpecCategories) { - this.activitySpecCategories = activitySpecCategories; - } + private static final long serialVersionUID = 6228647901909437418L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer ID; + + @BusinessKey + @Id + @Column(name = "ACTIVITY_SPEC_ID") + private Integer activitySpecId; + + @BusinessKey + @Id + @Column(name = "ACTIVITY_SPEC_CATEGORIES_ID") + private Integer activitySpecCategoriesId; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false) + private ActivitySpec activitySpec; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "ACTIVITY_SPEC_CATEGORIES_ID", updatable = false, insertable = false) + private ActivitySpecCategories activitySpecCategories; + + @Override + public String toString() { + return new ToStringBuilder(this).append("activitySpecId", activitySpecId) + .append("activitySpecCategoriesId", activitySpecCategoriesId).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ActivitySpecActivitySpecCategories)) { + return false; + } + ActivitySpecActivitySpecCategories castOther = (ActivitySpecActivitySpecCategories) other; + return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) + .append(activitySpecCategoriesId, castOther.activitySpecCategoriesId).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(activitySpecId).append(activitySpecCategoriesId).toHashCode(); + } + + public Integer getID() { + return ID; + } + + public Integer getActivitySpecId() { + return activitySpecId; + } + + public void setActivitySpecId(Integer activitySpecId) { + this.activitySpecId = activitySpecId; + } + + public Integer getActivitySpecCategoriesId() { + return activitySpecCategoriesId; + } + + public void setActivitySpecCategoriesId(Integer activitySpecCategoriesId) { + this.activitySpecCategoriesId = activitySpecCategoriesId; + } + + public ActivitySpec getActivitySpec() { + return activitySpec; + } + + public void setActivitySpec(ActivitySpec activitySpec) { + this.activitySpec = activitySpec; + } + + public ActivitySpecCategories getActivitySpecCategories() { + return activitySpecCategories; + } + + public void setActivitySpecCategories(ActivitySpecCategories activitySpecCategories) { + this.activitySpecCategories = activitySpecCategories; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategoriesId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategoriesId.java index e31c5fcece..e3dcd359ec 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategoriesId.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecCategoriesId.java @@ -21,60 +21,62 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - 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; public class ActivitySpecActivitySpecCategoriesId implements Serializable { - - private static final long serialVersionUID = 1563771827209840959L; - private Integer ID; - @BusinessKey - private Integer activitySpecId; - @BusinessKey - private Integer activitySpecCategoriesId; - - public Integer getID() { - return ID; - } - public void setID(Integer iD) { - ID = iD; - } - public Integer getActivitySpecCategoriesId() { - return activitySpecCategoriesId; - } - public void setActivitySpecCategoriesId(Integer activitySpecCategoriesId) { - this.activitySpecCategoriesId = activitySpecCategoriesId; - } - public Integer getActivitySpecId() { - return activitySpecId; - } - public void setActivitySpecId(Integer activitySpecId) { - this.activitySpecId = activitySpecId; - } - @Override - public String toString() { - return new ToStringBuilder(this).append("activitySpecId", activitySpecId) - .append("activitySpecCategoriesId", activitySpecCategoriesId) - .toString(); - } + private static final long serialVersionUID = 1563771827209840959L; + private Integer ID; + @BusinessKey + private Integer activitySpecId; + @BusinessKey + private Integer activitySpecCategoriesId; + + public Integer getID() { + return ID; + } + + public void setID(Integer iD) { + ID = iD; + } + + public Integer getActivitySpecCategoriesId() { + return activitySpecCategoriesId; + } + + public void setActivitySpecCategoriesId(Integer activitySpecCategoriesId) { + this.activitySpecCategoriesId = activitySpecCategoriesId; + } + + public Integer getActivitySpecId() { + return activitySpecId; + } + + public void setActivitySpecId(Integer activitySpecId) { + this.activitySpecId = activitySpecId; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("activitySpecId", activitySpecId) + .append("activitySpecCategoriesId", activitySpecCategoriesId).toString(); + } - @Override - public boolean equals(final Object other) { - if (!(other instanceof ActivitySpecActivitySpecCategoriesId)) { - return false; - } - ActivitySpecActivitySpecCategoriesId castOther = (ActivitySpecActivitySpecCategoriesId) other; - return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) - .append(activitySpecCategoriesId, castOther.activitySpecCategoriesId).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof ActivitySpecActivitySpecCategoriesId)) { + return false; + } + ActivitySpecActivitySpecCategoriesId castOther = (ActivitySpecActivitySpecCategoriesId) other; + return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) + .append(activitySpecCategoriesId, castOther.activitySpecCategoriesId).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(activitySpecId).append(activitySpecCategoriesId).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(activitySpecId).append(activitySpecCategoriesId).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParameters.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParameters.java index 181380244d..f0c9bd99ce 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParameters.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParameters.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -37,13 +36,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @@ -51,88 +47,86 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "activity_spec_to_activity_spec_parameters") public class ActivitySpecActivitySpecParameters implements Serializable { - private static final long serialVersionUID = -2036788837696381115L; - - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer ID; - - @BusinessKey - @Id - @Column(name = "ACTIVITY_SPEC_ID") - private Integer activitySpecId; - - @BusinessKey - @Id - @Column(name = "ACTIVITY_SPEC_PARAMETERS_ID") - private Integer activitySpecParametersId; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false) - private ActivitySpec activitySpec; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "ACTIVITY_SPEC_PARAMETERS_ID", updatable = false, insertable = false) - private ActivitySpecParameters activitySpecParameters; - - @Override - public String toString() { - return new ToStringBuilder(this) - .append("activitySpecId", activitySpecId) - .append("activitySpecCategoriesId", activitySpecParametersId) - .toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ActivitySpecActivitySpecParameters)) { - return false; - } - ActivitySpecActivitySpecParameters castOther = (ActivitySpecActivitySpecParameters) other; - return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) - .append(activitySpecParametersId, castOther.activitySpecParametersId).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(activitySpecId).append(activitySpecParametersId).toHashCode(); - } - - public Integer getID() { - return ID; - } - - public Integer getActivitySpecId() { - return activitySpecId; - } - - public void setActivitySpecId(Integer activitySpecId) { - this.activitySpecId = activitySpecId; - } - - public Integer getActivitySpecParametersId() { - return activitySpecParametersId; - } - - public void setActivitySpecParametersId(Integer activitySpecParametersId) { - this.activitySpecParametersId = activitySpecParametersId; - } - - public ActivitySpec getActivitySpec() { - return activitySpec; - } - - public void setActivitySpec(ActivitySpec activitySpec) { - this.activitySpec = activitySpec; - } - - public ActivitySpecParameters getActivitySpecParameters() { - return activitySpecParameters; - } - - public void setActivitySpecParameters(ActivitySpecParameters activitySpecParameters) { - this.activitySpecParameters = activitySpecParameters; - } + private static final long serialVersionUID = -2036788837696381115L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer ID; + + @BusinessKey + @Id + @Column(name = "ACTIVITY_SPEC_ID") + private Integer activitySpecId; + + @BusinessKey + @Id + @Column(name = "ACTIVITY_SPEC_PARAMETERS_ID") + private Integer activitySpecParametersId; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false) + private ActivitySpec activitySpec; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "ACTIVITY_SPEC_PARAMETERS_ID", updatable = false, insertable = false) + private ActivitySpecParameters activitySpecParameters; + + @Override + public String toString() { + return new ToStringBuilder(this).append("activitySpecId", activitySpecId) + .append("activitySpecCategoriesId", activitySpecParametersId).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ActivitySpecActivitySpecParameters)) { + return false; + } + ActivitySpecActivitySpecParameters castOther = (ActivitySpecActivitySpecParameters) other; + return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) + .append(activitySpecParametersId, castOther.activitySpecParametersId).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(activitySpecId).append(activitySpecParametersId).toHashCode(); + } + + public Integer getID() { + return ID; + } + + public Integer getActivitySpecId() { + return activitySpecId; + } + + public void setActivitySpecId(Integer activitySpecId) { + this.activitySpecId = activitySpecId; + } + + public Integer getActivitySpecParametersId() { + return activitySpecParametersId; + } + + public void setActivitySpecParametersId(Integer activitySpecParametersId) { + this.activitySpecParametersId = activitySpecParametersId; + } + + public ActivitySpec getActivitySpec() { + return activitySpec; + } + + public void setActivitySpec(ActivitySpec activitySpec) { + this.activitySpec = activitySpec; + } + + public ActivitySpecParameters getActivitySpecParameters() { + return activitySpecParameters; + } + + public void setActivitySpecParameters(ActivitySpecParameters activitySpecParameters) { + this.activitySpecParameters = activitySpecParameters; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParametersId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParametersId.java index 36c3a07c3f..8f4cc6d966 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParametersId.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecActivitySpecParametersId.java @@ -21,61 +21,63 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - 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; public class ActivitySpecActivitySpecParametersId implements Serializable { - - private static final long serialVersionUID = 1563771827209840959L; - - private Integer ID; - @BusinessKey - private Integer activitySpecId; - @BusinessKey - private Integer activitySpecParametersId; - - public Integer getID() { - return ID; - } - public void setID(Integer iD) { - ID = iD; - } - public Integer getActivitySpecParametersId() { - return activitySpecParametersId; - } - public void setActivitySpecParametersId(Integer activitySpecParametersId) { - this.activitySpecParametersId = activitySpecParametersId; - } - public Integer getActivitySpecId() { - return activitySpecId; - } - public void setActivitySpecId(Integer activitySpecId) { - this.activitySpecId = activitySpecId; - } - @Override - public String toString() { - return new ToStringBuilder(this).append("activitySpecId", activitySpecId) - .append("activitySpecCategoriesId", activitySpecParametersId) - .toString(); - } + private static final long serialVersionUID = 1563771827209840959L; + + private Integer ID; + @BusinessKey + private Integer activitySpecId; + @BusinessKey + private Integer activitySpecParametersId; + + public Integer getID() { + return ID; + } + + public void setID(Integer iD) { + ID = iD; + } + + public Integer getActivitySpecParametersId() { + return activitySpecParametersId; + } + + public void setActivitySpecParametersId(Integer activitySpecParametersId) { + this.activitySpecParametersId = activitySpecParametersId; + } + + public Integer getActivitySpecId() { + return activitySpecId; + } + + public void setActivitySpecId(Integer activitySpecId) { + this.activitySpecId = activitySpecId; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("activitySpecId", activitySpecId) + .append("activitySpecCategoriesId", activitySpecParametersId).toString(); + } - @Override - public boolean equals(final Object other) { - if (!(other instanceof ActivitySpecActivitySpecParametersId)) { - return false; - } - ActivitySpecActivitySpecParametersId castOther = (ActivitySpecActivitySpecParametersId) other; - return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) - .append(activitySpecParametersId, castOther.activitySpecParametersId).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof ActivitySpecActivitySpecParametersId)) { + return false; + } + ActivitySpecActivitySpecParametersId castOther = (ActivitySpecActivitySpecParametersId) other; + return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) + .append(activitySpecParametersId, castOther.activitySpecParametersId).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(activitySpecId).append(activitySpecParametersId).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(activitySpecId).append(activitySpecParametersId).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java index 737b174a9b..a42a73aac9 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecCategories.java @@ -4,7 +4,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -19,13 +18,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import org.hibernate.annotations.NotFound; import org.hibernate.annotations.NotFoundAction; import uk.co.blackpepper.bowman.annotation.LinkedResource; @@ -34,58 +30,59 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "ACTIVITY_SPEC_CATEGORIES") public class ActivitySpecCategories implements Serializable { - private static final long serialVersionUID = -6251150462067699643L; + private static final long serialVersionUID = -6251150462067699643L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer ID; + + @BusinessKey + @Column(name = "NAME") + private String name; + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpecCategories") + private List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories; + + public Integer getID() { + return ID; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer ID; - - @BusinessKey - @Column(name = "NAME") - private String name; - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpecCategories") - private List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories; - - public Integer getID() { - return ID; - } - - public String getName() { - return name; - } + @LinkedResource + public List<ActivitySpecActivitySpecCategories> getActivitySpecActivitySpecCategories() { + return activitySpecActivitySpecCategories; + } - public void setName(String name) { - this.name = name; - } + public void setActivitySpecActivitySpecCategories( + List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories) { + this.activitySpecActivitySpecCategories = activitySpecActivitySpecCategories; + } - @LinkedResource - public List<ActivitySpecActivitySpecCategories> getActivitySpecActivitySpecCategories() { - return activitySpecActivitySpecCategories; - } + @Override + public String toString() { + return new ToStringBuilder(this).append("name", name) + .append("activitySpecActivitySpecCategories", activitySpecActivitySpecCategories).toString(); + } - public void setActivitySpecActivitySpecCategories( - List<ActivitySpecActivitySpecCategories> activitySpecActivitySpecCategories) { - this.activitySpecActivitySpecCategories = activitySpecActivitySpecCategories; - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("name", name) - .append("activitySpecActivitySpecCategories", activitySpecActivitySpecCategories).toString(); - } - @Override - public boolean equals(final Object other) { - if (!(other instanceof ActivitySpecCategories)) { - return false; - } - ActivitySpecCategories castOther = (ActivitySpecCategories) other; - return new EqualsBuilder().append(name, castOther.name).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof ActivitySpecCategories)) { + return false; + } + ActivitySpecCategories castOther = (ActivitySpecCategories) other; + return new EqualsBuilder().append(name, castOther.name).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(name).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(name).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java index 9e3e301456..49e0f3fa79 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecParameters.java @@ -4,7 +4,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -20,13 +19,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import org.hibernate.annotations.NotFound; import org.hibernate.annotations.NotFoundAction; import uk.co.blackpepper.bowman.annotation.LinkedResource; @@ -34,110 +30,111 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "ACTIVITY_SPEC_PARAMETERS") public class ActivitySpecParameters implements Serializable { - - private static final long serialVersionUID = 3627711377147710046L; - - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer ID; - - @BusinessKey - @Column(name = "NAME") - private String name; - - @Column(name = "TYPE") - private String type; - - @BusinessKey - @Column(name = "DIRECTION") - private String direction; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpecParameters") - private List<ActivitySpecActivitySpecParameters> activitySpecActivitySpecParameters; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @LinkedResource - public List<ActivitySpecActivitySpecParameters> getActivitySpecActivitySpecParameters() { - return activitySpecActivitySpecParameters; - } - - public void setActivitySpecActivitySpecParameters( - List<ActivitySpecActivitySpecParameters> activitySpecActivitySpecParameters) { - this.activitySpecActivitySpecParameters = activitySpecActivitySpecParameters; - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("name", name).append("direction", direction) - .append("activitySpecActivitySpecParameters", activitySpecActivitySpecParameters).toString(); - } - @Override - public boolean equals(final Object other) { - if (!(other instanceof ActivitySpecParameters)) { - return false; - } - ActivitySpecParameters castOther = (ActivitySpecParameters) other; - return new EqualsBuilder().append(ID, castOther.ID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(ID).toHashCode(); - } - - public Integer getID() { - return ID; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getDirection() { - return direction; - } - - public void setDirection(String direction) { - this.direction = direction; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } + + private static final long serialVersionUID = 3627711377147710046L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer ID; + + @BusinessKey + @Column(name = "NAME") + private String name; + + @Column(name = "TYPE") + private String type; + + @BusinessKey + @Column(name = "DIRECTION") + private String direction; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "activitySpecParameters") + private List<ActivitySpecActivitySpecParameters> activitySpecActivitySpecParameters; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @LinkedResource + public List<ActivitySpecActivitySpecParameters> getActivitySpecActivitySpecParameters() { + return activitySpecActivitySpecParameters; + } + + public void setActivitySpecActivitySpecParameters( + List<ActivitySpecActivitySpecParameters> activitySpecActivitySpecParameters) { + this.activitySpecActivitySpecParameters = activitySpecActivitySpecParameters; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("name", name).append("direction", direction) + .append("activitySpecActivitySpecParameters", activitySpecActivitySpecParameters).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ActivitySpecParameters)) { + return false; + } + ActivitySpecParameters castOther = (ActivitySpecParameters) other; + return new EqualsBuilder().append(ID, castOther.ID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(ID).toHashCode(); + } + + public Integer getID() { + return ID; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getDirection() { + return direction; + } + + public void setDirection(String direction) { + this.direction = direction; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParameters.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParameters.java index 8cf3351274..be32da379e 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParameters.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParameters.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -37,13 +36,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @@ -51,88 +47,86 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "activity_spec_to_user_parameters") public class ActivitySpecUserParameters implements Serializable { - private static final long serialVersionUID = 5599242118780268449L; - - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer ID; - - @BusinessKey - @Id - @Column(name = "ACTIVITY_SPEC_ID") - private Integer activitySpecId; - - @BusinessKey - @Id - @Column(name = "USER_PARAMETERS_ID") - private Integer userParametersId; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false) - private ActivitySpec activitySpec; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "USER_PARAMETERS_ID", updatable = false, insertable = false) - private UserParameters userParameters; - - @Override - public String toString() { - return new ToStringBuilder(this) - .append("activitySpecId", activitySpecId) - .append("userParametersId", userParametersId) - .toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ActivitySpecUserParameters)) { - return false; - } - ActivitySpecUserParameters castOther = (ActivitySpecUserParameters) other; - return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) - .append(userParametersId, castOther.userParametersId).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(activitySpecId).append(userParametersId).toHashCode(); - } - - public Integer getID() { - return ID; - } - - public Integer getActivitySpecId() { - return activitySpecId; - } - - public void setActivitySpecId(Integer activitySpecId) { - this.activitySpecId = activitySpecId; - } - - public Integer getUserParametersId() { - return userParametersId; - } - - public void setUserParametersId(Integer userParametersId) { - this.userParametersId = userParametersId; - } - - public ActivitySpec getActivitySpec() { - return activitySpec; - } - - public void setActivitySpec(ActivitySpec activitySpec) { - this.activitySpec = activitySpec; - } - - public UserParameters getUserParameters() { - return userParameters; - } - - public void setUserParameters(UserParameters userParameters) { - this.userParameters = userParameters; - } + private static final long serialVersionUID = 5599242118780268449L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer ID; + + @BusinessKey + @Id + @Column(name = "ACTIVITY_SPEC_ID") + private Integer activitySpecId; + + @BusinessKey + @Id + @Column(name = "USER_PARAMETERS_ID") + private Integer userParametersId; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false) + private ActivitySpec activitySpec; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "USER_PARAMETERS_ID", updatable = false, insertable = false) + private UserParameters userParameters; + + @Override + public String toString() { + return new ToStringBuilder(this).append("activitySpecId", activitySpecId) + .append("userParametersId", userParametersId).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ActivitySpecUserParameters)) { + return false; + } + ActivitySpecUserParameters castOther = (ActivitySpecUserParameters) other; + return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) + .append(userParametersId, castOther.userParametersId).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(activitySpecId).append(userParametersId).toHashCode(); + } + + public Integer getID() { + return ID; + } + + public Integer getActivitySpecId() { + return activitySpecId; + } + + public void setActivitySpecId(Integer activitySpecId) { + this.activitySpecId = activitySpecId; + } + + public Integer getUserParametersId() { + return userParametersId; + } + + public void setUserParametersId(Integer userParametersId) { + this.userParametersId = userParametersId; + } + + public ActivitySpec getActivitySpec() { + return activitySpec; + } + + public void setActivitySpec(ActivitySpec activitySpec) { + this.activitySpec = activitySpec; + } + + public UserParameters getUserParameters() { + return userParameters; + } + + public void setUserParameters(UserParameters userParameters) { + this.userParameters = userParameters; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParametersId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParametersId.java index 3e739ac013..fd55d6e961 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParametersId.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ActivitySpecUserParametersId.java @@ -21,62 +21,64 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - 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; public class ActivitySpecUserParametersId implements Serializable { - - private static final long serialVersionUID = 1563771827209840959L; - private Integer ID; - @BusinessKey - private Integer activitySpecId; - @BusinessKey - private Integer userParametersId; - - public Integer getID() { - return ID; - } - public void setID(Integer iD) { - ID = iD; - } - public Integer getUserParametersId() { - return userParametersId; - } - public void setUserParametersId(Integer userParametersId) { - this.userParametersId = userParametersId; - } - public Integer getActivitySpecId() { - return activitySpecId; - } - public void setActivitySpecId(Integer activitySpecId) { - this.activitySpecId = activitySpecId; - } + private static final long serialVersionUID = 1563771827209840959L; + + private Integer ID; + @BusinessKey + private Integer activitySpecId; + @BusinessKey + private Integer userParametersId; + + public Integer getID() { + return ID; + } + + public void setID(Integer iD) { + ID = iD; + } + + public Integer getUserParametersId() { + return userParametersId; + } + + public void setUserParametersId(Integer userParametersId) { + this.userParametersId = userParametersId; + } + + public Integer getActivitySpecId() { + return activitySpecId; + } + + public void setActivitySpecId(Integer activitySpecId) { + this.activitySpecId = activitySpecId; + } - @Override - public String toString() { - return new ToStringBuilder(this).append("activitySpecId", activitySpecId) - .append("userParametersId", userParametersId) - .toString(); - } + @Override + public String toString() { + return new ToStringBuilder(this).append("activitySpecId", activitySpecId) + .append("userParametersId", userParametersId).toString(); + } - @Override - public boolean equals(final Object other) { - if (!(other instanceof ActivitySpecUserParametersId)) { - return false; - } - ActivitySpecUserParametersId castOther = (ActivitySpecUserParametersId) other; - return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) - .append(userParametersId, castOther.userParametersId).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof ActivitySpecUserParametersId)) { + return false; + } + ActivitySpecUserParametersId castOther = (ActivitySpecUserParametersId) other; + return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) + .append(userParametersId, castOther.userParametersId).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(activitySpecId).append(userParametersId).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(activitySpecId).append(userParametersId).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResource.java index 1d3ee7c36e..c3a662d883 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResource.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResource.java @@ -24,7 +24,6 @@ import java.io.Serializable; import java.util.Date; import java.util.HashSet; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,148 +33,145 @@ import javax.persistence.PrePersist; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; - import com.fasterxml.jackson.annotation.JsonFormat; 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 = "allotted_resource") public class AllottedResource implements Serializable { - private static final long serialVersionUID = 768026109321305392L; - @BusinessKey - @Id - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Column(name = "SUBCATEGORY") - private String subcategory; - - @Column(name = "DESCRIPTION") - private String description; - - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "allottedResource") - private Set<AllottedResourceCustomization> allotedResourceCustomization; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) - .append("modelVersion", modelVersion).append("modelName", modelName) - .append("toscaNodeType", toscaNodeType).append("subcategory", subcategory) - .append("description", description).append("created", created) - .append("allotedResourceCustomization", allotedResourceCustomization).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof AllottedResource)) { - return false; - } - AllottedResource castOther = (AllottedResource) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @LinkedResource - public Set<AllottedResourceCustomization> getAllotedResourceCustomization() { - if (allotedResourceCustomization == null) - allotedResourceCustomization = new HashSet<>(); - return allotedResourceCustomization; - } - - public void setAllotedResourceCustomization(Set<AllottedResourceCustomization> allotedResourceCustomization) { - this.allotedResourceCustomization = allotedResourceCustomization; - } - - public String getModelUUID() { - return this.modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelInvariantUUID() { - return this.modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return this.modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getModelName() { - return this.modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getToscaNodeType() { - return this.toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public String getSubcategory() { - return this.subcategory; - } - - public void setSubcategory(String subcategory) { - this.subcategory = subcategory; - } - - public String getDescription() { - return this.description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } + private static final long serialVersionUID = 768026109321305392L; + @BusinessKey + @Id + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; + + @Column(name = "SUBCATEGORY") + private String subcategory; + + @Column(name = "DESCRIPTION") + private String description; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "allottedResource") + private Set<AllottedResourceCustomization> allotedResourceCustomization; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) + .append("modelVersion", modelVersion).append("modelName", modelName) + .append("toscaNodeType", toscaNodeType).append("subcategory", subcategory) + .append("description", description).append("created", created) + .append("allotedResourceCustomization", allotedResourceCustomization).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof AllottedResource)) { + return false; + } + AllottedResource castOther = (AllottedResource) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @LinkedResource + public Set<AllottedResourceCustomization> getAllotedResourceCustomization() { + if (allotedResourceCustomization == null) + allotedResourceCustomization = new HashSet<>(); + return allotedResourceCustomization; + } + + public void setAllotedResourceCustomization(Set<AllottedResourceCustomization> allotedResourceCustomization) { + this.allotedResourceCustomization = allotedResourceCustomization; + } + + public String getModelUUID() { + return this.modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelInvariantUUID() { + return this.modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return this.modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getModelName() { + return this.modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getToscaNodeType() { + return this.toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public String getSubcategory() { + return this.subcategory; + } + + public void setSubcategory(String subcategory) { + this.subcategory = subcategory; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResourceCustomization.java index 04b93c3886..b3734caccc 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AllottedResourceCustomization.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,222 +33,219 @@ import javax.persistence.PrePersist; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; - import com.fasterxml.jackson.annotation.JsonFormat; 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 = "allotted_resource_customization") public class AllottedResourceCustomization implements Serializable { - private static final long serialVersionUID = 768026109321305392L; + private static final long serialVersionUID = 768026109321305392L; - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") - @Temporal(TemporalType.TIMESTAMP) - private Date created; + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + @Temporal(TemporalType.TIMESTAMP) + private Date created; - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "PROVIDING_SERVICE_MODEL_INVARIANT_UUID") - private String providingServiceModelInvariantUUID; + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "PROVIDING_SERVICE_MODEL_INVARIANT_UUID") + private String providingServiceModelInvariantUUID; - @Column(name = "PROVIDING_SERVICE_MODEL_UUID") - private String providingServiceModelUUID; + @Column(name = "PROVIDING_SERVICE_MODEL_UUID") + private String providingServiceModelUUID; - @Column(name = "PROVIDING_SERVICE_MODEL_NAME") - private String providingServiceModelName; + @Column(name = "PROVIDING_SERVICE_MODEL_NAME") + private String providingServiceModelName; - @Column(name = "TARGET_NETWORK_ROLE") - private String targetNetworkRole; - - @Column(name = "NF_FUNCTION") - private String nfFunction; + @Column(name = "TARGET_NETWORK_ROLE") + private String targetNetworkRole; + + @Column(name = "NF_FUNCTION") + private String nfFunction; - @Column(name = "NF_TYPE") - private String nfType; + @Column(name = "NF_TYPE") + private String nfType; - @Column(name = "NF_ROLE") - private String nfRole; - - @Column(name = "NF_NAMING_CODE") - private String nfNamingCode; - - @Column(name = "MIN_INSTANCES") - private Integer minInstances; + @Column(name = "NF_ROLE") + private String nfRole; + + @Column(name = "NF_NAMING_CODE") + private String nfNamingCode; + + @Column(name = "MIN_INSTANCES") + private Integer minInstances; - @Column(name = "MAX_INSTANCES") - private Integer maxInstances; + @Column(name = "MAX_INSTANCES") + private Integer maxInstances; - @Column(name = "RESOURCE_INPUT") - private String resourceInput; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "AR_MODEL_UUID") - private AllottedResource allottedResource; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("created", created).append("modelInstanceName", modelInstanceName) - .append("providingServiceModelInvariantUUID", providingServiceModelInvariantUUID) - .append("providingServiceModelUUID", providingServiceModelUUID) - .append("providingServiceModelName", providingServiceModelName) - .append("targetNetworkRole", targetNetworkRole).append("nfFunction", nfFunction) - .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode) - .append("minInstances", minInstances).append("maxInstances", maxInstances) - .append("allottedResource", allottedResource).toString(); - } + @Column(name = "RESOURCE_INPUT") + private String resourceInput; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "AR_MODEL_UUID") + private AllottedResource allottedResource; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("created", created).append("modelInstanceName", modelInstanceName) + .append("providingServiceModelInvariantUUID", providingServiceModelInvariantUUID) + .append("providingServiceModelUUID", providingServiceModelUUID) + .append("providingServiceModelName", providingServiceModelName) + .append("targetNetworkRole", targetNetworkRole).append("nfFunction", nfFunction) + .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode) + .append("minInstances", minInstances).append("maxInstances", maxInstances) + .append("allottedResource", allottedResource).toString(); + } - @PrePersist - protected void onCreate() { - this.created = new Date(); - } + @PrePersist + protected void onCreate() { + this.created = new Date(); + } - @Override - public boolean equals(final Object other) { - if (!(other instanceof AllottedResourceCustomization)) { - return false; - } - AllottedResourceCustomization castOther = (AllottedResourceCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); - } - - public String getProvidingServiceModelUUID() { - return providingServiceModelUUID; - } - - public void setProvidingServiceModelUUID(String providingServiceModelUUID) { - this.providingServiceModelUUID = providingServiceModelUUID; - } - - public String getProvidingServiceModelName() { - return providingServiceModelName; - } - - public void setProvidingServiceModelName(String providingServiceModelName) { - this.providingServiceModelName = providingServiceModelName; - } - - public AllottedResourceCustomization() { - super(); - } - - public String getModelCustomizationUUID() { - return this.modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public Date getCreated() { - return this.created; - } - - public String getModelInstanceName() { - return this.modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - @LinkedResource - public AllottedResource getAllottedResource() { - return this.allottedResource; - } - - public void setAllottedResource(AllottedResource allottedResource) { - this.allottedResource = allottedResource; - } - - public String getProvidingServiceModelInvariantUUID() { - return this.providingServiceModelInvariantUUID; - } - - public void setProvidingServiceModelInvariantUUID(String providingServiceModelInvariantUUID) { - this.providingServiceModelInvariantUUID = providingServiceModelInvariantUUID; - } - - public String getTargetNetworkRole() { - return this.targetNetworkRole; - } - - public void setTargetNetworkRole(String targetNetworkRole) { - this.targetNetworkRole = targetNetworkRole; - } - - public String getNfFunction() { - return this.nfFunction; - } - - public void setNfFunction(String nfFunction) { - this.nfFunction = nfFunction; - } - - public String getNfType() { - return this.nfType; - } - - public void setNfType(String nfType) { - this.nfType = nfType; - } - - public String getNfRole() { - return this.nfRole; - } - - public void setNfRole(String nfRole) { - this.nfRole = nfRole; - } - - public String getNfNamingCode() { - return this.nfNamingCode; - } - - public void setNfNamingCode(String nfNamingCode) { - this.nfNamingCode = nfNamingCode; - } - - 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 String getResourceInput() { - return resourceInput; - } - - public void setResourceInput(String resourceInput) { - this.resourceInput = resourceInput; - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof AllottedResourceCustomization)) { + return false; + } + AllottedResourceCustomization castOther = (AllottedResourceCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); + } + + public String getProvidingServiceModelUUID() { + return providingServiceModelUUID; + } + + public void setProvidingServiceModelUUID(String providingServiceModelUUID) { + this.providingServiceModelUUID = providingServiceModelUUID; + } + + public String getProvidingServiceModelName() { + return providingServiceModelName; + } + + public void setProvidingServiceModelName(String providingServiceModelName) { + this.providingServiceModelName = providingServiceModelName; + } + + public AllottedResourceCustomization() { + super(); + } + + public String getModelCustomizationUUID() { + return this.modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public Date getCreated() { + return this.created; + } + + public String getModelInstanceName() { + return this.modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + @LinkedResource + public AllottedResource getAllottedResource() { + return this.allottedResource; + } + + public void setAllottedResource(AllottedResource allottedResource) { + this.allottedResource = allottedResource; + } + + public String getProvidingServiceModelInvariantUUID() { + return this.providingServiceModelInvariantUUID; + } + + public void setProvidingServiceModelInvariantUUID(String providingServiceModelInvariantUUID) { + this.providingServiceModelInvariantUUID = providingServiceModelInvariantUUID; + } + + public String getTargetNetworkRole() { + return this.targetNetworkRole; + } + + public void setTargetNetworkRole(String targetNetworkRole) { + this.targetNetworkRole = targetNetworkRole; + } + + public String getNfFunction() { + return this.nfFunction; + } + + public void setNfFunction(String nfFunction) { + this.nfFunction = nfFunction; + } + + public String getNfType() { + return this.nfType; + } + + public void setNfType(String nfType) { + this.nfType = nfType; + } + + public String getNfRole() { + return this.nfRole; + } + + public void setNfRole(String nfRole) { + this.nfRole = nfRole; + } + + public String getNfNamingCode() { + return this.nfNamingCode; + } + + public void setNfNamingCode(String nfNamingCode) { + this.nfNamingCode = nfNamingCode; + } + + 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 String getResourceInput() { + return resourceInput; + } + + public void setResourceInput(String resourceInput) { + this.resourceInput = resourceInput; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ArRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ArRecipe.java index 86ff743475..176c02c8cd 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ArRecipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ArRecipe.java @@ -22,163 +22,160 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; 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 com.openpojo.business.annotation.BusinessKey; @Entity @Table(name = "ar_recipe") public class ArRecipe implements Recipe, Serializable { - private static final long serialVersionUID = 768026109321305392L; - - @Id - @Column(name = "ID", nullable = false) - private Integer id; - @BusinessKey - @Column(name = "MODEL_NAME", nullable = false) - private String modelName; - @BusinessKey - @Column(name = "ACTION", nullable = false) - private String action; - - @Column(name = "VERSION_STR", nullable = false) - private String version; - @BusinessKey - @Column(name = "SERVICE_TYPE") - private String serviceType; - - @Column(name = "DESCRIPTION") - private String description; - @BusinessKey - @Column(name = "ORCHESTRATION_URI", nullable = false) - private String orchestrationUri; - - @Column(name = "AR_PARAM_XSD") - private String paramXsd; - - @Column(name = "RECIPE_TIMEOUT") - private Integer recipeTimeout; - - @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getServiceType() { - return serviceType; - } - - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getOrchestrationUri() { - return orchestrationUri; - } - - public void setOrchestrationUri(String orchestrationUri) { - this.orchestrationUri = orchestrationUri; - } - - public String getParamXsd() { - return paramXsd; - } - - public void setParamXsd(String paramXsd) { - this.paramXsd = paramXsd; - } - - public Integer getRecipeTimeout() { - return recipeTimeout; - } - - public void setRecipeTimeout(Integer recipeTimeout) { - this.recipeTimeout = recipeTimeout; - } - - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelName", getModelName()).append("action", getAction()) - .append("version", getVersion()).append("serviceType", getServiceType()) - .append("description", getDescription()).append("orchestrationUri", getOrchestrationUri()) - .append("paramXSD", getParamXsd()).append("recipeTimeout", getRecipeTimeout()) - .append("created", getCreated()).toString(); - } - - @Override - public boolean equals(final Object other) { - if (this == other) { - return true; - } - if (!(other instanceof ArRecipe)) { - return false; - } - ArRecipe castOther = (ArRecipe) other; - return new EqualsBuilder().append(getId(), castOther.getId()).append(getModelName(), castOther.getModelName()) - .append(getAction(), castOther.getAction()).append(getServiceType(), castOther.getServiceType()) - .append(getOrchestrationUri(), castOther.getOrchestrationUri()).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(getId()).append(getModelName()).append(getAction()).append(getServiceType()) - .append(getOrchestrationUri()).toHashCode(); - } + private static final long serialVersionUID = 768026109321305392L; + + @Id + @Column(name = "ID", nullable = false) + private Integer id; + @BusinessKey + @Column(name = "MODEL_NAME", nullable = false) + private String modelName; + @BusinessKey + @Column(name = "ACTION", nullable = false) + private String action; + + @Column(name = "VERSION_STR", nullable = false) + private String version; + @BusinessKey + @Column(name = "SERVICE_TYPE") + private String serviceType; + + @Column(name = "DESCRIPTION") + private String description; + @BusinessKey + @Column(name = "ORCHESTRATION_URI", nullable = false) + private String orchestrationUri; + + @Column(name = "AR_PARAM_XSD") + private String paramXsd; + + @Column(name = "RECIPE_TIMEOUT") + private Integer recipeTimeout; + + @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getOrchestrationUri() { + return orchestrationUri; + } + + public void setOrchestrationUri(String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + public String getParamXsd() { + return paramXsd; + } + + public void setParamXsd(String paramXsd) { + this.paramXsd = paramXsd; + } + + public Integer getRecipeTimeout() { + return recipeTimeout; + } + + public void setRecipeTimeout(Integer recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelName", getModelName()).append("action", getAction()) + .append("version", getVersion()).append("serviceType", getServiceType()) + .append("description", getDescription()).append("orchestrationUri", getOrchestrationUri()) + .append("paramXSD", getParamXsd()).append("recipeTimeout", getRecipeTimeout()) + .append("created", getCreated()).toString(); + } + + @Override + public boolean equals(final Object other) { + if (this == other) { + return true; + } + if (!(other instanceof ArRecipe)) { + return false; + } + ArRecipe castOther = (ArRecipe) other; + return new EqualsBuilder().append(getId(), castOther.getId()).append(getModelName(), castOther.getModelName()) + .append(getAction(), castOther.getAction()).append(getServiceType(), castOther.getServiceType()) + .append(getOrchestrationUri(), castOther.getOrchestrationUri()).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(getId()).append(getModelName()).append(getAction()).append(getServiceType()) + .append(getOrchestrationUri()).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AuthenticationType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AuthenticationType.java index b1cb07447d..c0f60325ea 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AuthenticationType.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/AuthenticationType.java @@ -21,5 +21,5 @@ package org.onap.so.db.catalog.beans; public enum AuthenticationType { - USERNAME_PASSWORD, RACKSPACE_APIKEY; + USERNAME_PASSWORD, RACKSPACE_APIKEY; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockDetail.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockDetail.java index cc2abacce2..54e2144c81 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockDetail.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/BuildingBlockDetail.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,85 +33,83 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; 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 org.onap.so.db.catalog.beans.macro.OrchestrationFlow; - import com.openpojo.business.annotation.BusinessKey; @Entity @Table(name = "building_block_detail") public class BuildingBlockDetail implements Serializable { - private static final long serialVersionUID = -2375223199178059155L; - - @Id - @Column(name = "id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @BusinessKey - @Column(name = "BUILDING_BLOCK_NAME") - private String buildingBlockName; - - @Enumerated(EnumType.STRING) - @Column(name = "RESOURCE_TYPE") - private ResourceType resourceType; - - @Enumerated(EnumType.STRING) - @Column(name = "TARGET_ACTION") - private OrchestrationAction targetAction; - - @Override - public String toString() { - return new ToStringBuilder(this).append("buildingBlockName", buildingBlockName) - .append("resourceType", resourceType).append("targetAction", targetAction).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof BuildingBlockDetail)) { - return false; - } - BuildingBlockDetail castOther = (BuildingBlockDetail) other; - return new EqualsBuilder().append(buildingBlockName, castOther.buildingBlockName).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(buildingBlockName).toHashCode(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getBuildingBlockName() { - return buildingBlockName; - } - - public void setBuildingBlockName(String buildingBlockName) { - this.buildingBlockName = buildingBlockName; - } - - public ResourceType getResourceType() { - return resourceType; - } - - public void setResourceType(ResourceType resourceType) { - this.resourceType = resourceType; - } - - public OrchestrationAction getTargetAction() { - return targetAction; - } - - public void setTargetAction(OrchestrationAction targetAction) { - this.targetAction = targetAction; - } + private static final long serialVersionUID = -2375223199178059155L; + + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @BusinessKey + @Column(name = "BUILDING_BLOCK_NAME") + private String buildingBlockName; + + @Enumerated(EnumType.STRING) + @Column(name = "RESOURCE_TYPE") + private ResourceType resourceType; + + @Enumerated(EnumType.STRING) + @Column(name = "TARGET_ACTION") + private OrchestrationAction targetAction; + + @Override + public String toString() { + return new ToStringBuilder(this).append("buildingBlockName", buildingBlockName) + .append("resourceType", resourceType).append("targetAction", targetAction).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof BuildingBlockDetail)) { + return false; + } + BuildingBlockDetail castOther = (BuildingBlockDetail) other; + return new EqualsBuilder().append(buildingBlockName, castOther.buildingBlockName).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(buildingBlockName).toHashCode(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getBuildingBlockName() { + return buildingBlockName; + } + + public void setBuildingBlockName(String buildingBlockName) { + this.buildingBlockName = buildingBlockName; + } + + public ResourceType getResourceType() { + return resourceType; + } + + public void setResourceType(ResourceType resourceType) { + this.resourceType = resourceType; + } + + public OrchestrationAction getTargetAction() { + return targetAction; + } + + public void setTargetAction(OrchestrationAction targetAction) { + this.targetAction = targetAction; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java index bb01f6f804..7dd163bafa 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudIdentity.java @@ -23,13 +23,10 @@ package org.onap.so.db.catalog.beans; import com.fasterxml.jackson.annotation.JsonProperty; import com.openpojo.business.annotation.BusinessKey; import org.apache.commons.lang3.builder.HashCodeBuilder; - import java.util.Date; - import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; @@ -41,9 +38,8 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; /** - * EntityBean class for a CloudIdentity. This bean represents a cloud identity - * service instance (i.e. a DCP node) in the NVP/AIC cloud. It will be loaded via - * CloudConfig object, of which it is a component. + * EntityBean class for a CloudIdentity. This bean represents a cloud identity service instance (i.e. a DCP node) in the + * NVP/AIC cloud. It will be loaded via CloudConfig object, of which it is a component. * */ @Entity @@ -55,53 +51,53 @@ public class CloudIdentity { @Id @Column(name = "ID") private String id; - + @JsonProperty("identity_url") @BusinessKey @Column(name = "IDENTITY_URL") private String identityUrl; - + @JsonProperty("mso_id") @BusinessKey @Column(name = "MSO_ID") private String msoId; - + @JsonProperty("mso_pass") @BusinessKey @Column(name = "MSO_PASS") private String msoPass; - + @JsonProperty("project_domain_name") @BusinessKey @Column(name = "PROJECT_DOMAIN_NAME") private String projectDomainName; - + @JsonProperty("user_domain_name") @BusinessKey @Column(name = "USER_DOMAIN_NAME") private String userDomainName; - + @JsonProperty("admin_tenant") @BusinessKey @Column(name = "ADMIN_TENANT") private String adminTenant; - + @JsonProperty("member_role") @BusinessKey @Column(name = "MEMBER_ROLE") private String memberRole; - + @JsonProperty("tenant_metadata") @BusinessKey @Column(name = "TENANT_METADATA") private Boolean tenantMetadata; - + @JsonProperty("identity_server_type") @BusinessKey @Enumerated(EnumType.STRING) @Column(name = "IDENTITY_SERVER_TYPE") private ServerType identityServerType; - + @JsonProperty("identity_authentication_type") @BusinessKey @Enumerated(EnumType.STRING) @@ -111,7 +107,7 @@ public class CloudIdentity { @JsonProperty("last_updated_by") @BusinessKey @Column(name = "LAST_UPDATED_BY") - private String lastUpdatedBy ; + private String lastUpdatedBy; @JsonProperty("creation_timestamp") @BusinessKey @@ -124,7 +120,7 @@ public class CloudIdentity { @Column(name = "UPDATE_TIMESTAMP") @Temporal(TemporalType.TIMESTAMP) private Date updated; - + public CloudIdentity() {} @PrePersist @@ -133,38 +129,39 @@ public class CloudIdentity { this.updated = new Date(); } - public String getId () { + public String getId() { return id; } - public void setId (String id) { + public void setId(String id) { this.id = id; } public String getIdentityUrl() { - return this.identityUrl; + return this.identityUrl; } + public void setIdentityUrl(String url) { - this.identityUrl = url; + this.identityUrl = url; } - public String getMsoId () { + public String getMsoId() { return msoId; } - public void setMsoId (String id) { + public void setMsoId(String id) { this.msoId = id; } - public String getMsoPass () { + public String getMsoPass() { return msoPass; } - public void setMsoPass (String pwd) { + public void setMsoPass(String pwd) { this.msoPass = pwd; } - public String getAdminTenant () { + public String getAdminTenant() { return adminTenant; } @@ -192,15 +189,15 @@ public class CloudIdentity { this.updated = updated; } - public void setAdminTenant (String tenant) { + public void setAdminTenant(String tenant) { this.adminTenant = tenant; } - public String getMemberRole () { + public String getMemberRole() { return memberRole; } - public void setMemberRole (String role) { + public void setMemberRole(String role) { this.memberRole = role; } @@ -208,100 +205,106 @@ public class CloudIdentity { return tenantMetadata; } - public void setTenantMetadata (Boolean meta) { + public void setTenantMetadata(Boolean meta) { this.tenantMetadata = meta; } - + public ServerType getIdentityServerType() { - return this.identityServerType; + return this.identityServerType; } + public void setIdentityServerType(ServerType ist) { - this.identityServerType = ist; + this.identityServerType = ist; } + public String getIdentityServerTypeAsString() { - return this.identityServerType.toString(); + return this.identityServerType.toString(); } + /** - * @return the identityAuthenticationType - */ - public AuthenticationType getIdentityAuthenticationType() { - return identityAuthenticationType; - } - - /** - * @param identityAuthenticationType the identityAuthenticationType to set - */ - public void setIdentityAuthenticationType(AuthenticationType identityAuthenticationType) { - this.identityAuthenticationType = identityAuthenticationType; - } - - public String getProjectDomainName() { - return projectDomainName; - } - - public void setProjectDomainName(String projectDomainName) { - this.projectDomainName = projectDomainName; - } - - public String getUserDomainName() { - return userDomainName; - } - - public void setUserDomainName(String userDomainName) { - this.userDomainName = userDomainName; - } - @Override - public CloudIdentity clone() { - CloudIdentity cloudIdentityCopy = new CloudIdentity(); - - cloudIdentityCopy.id = this.id; - cloudIdentityCopy.identityUrl = this.identityUrl; - cloudIdentityCopy.msoId = this.msoId; - cloudIdentityCopy.msoPass = this.msoPass; - cloudIdentityCopy.adminTenant = this.adminTenant; - cloudIdentityCopy.memberRole = this.memberRole; - cloudIdentityCopy.tenantMetadata = this.tenantMetadata; - cloudIdentityCopy.identityServerType = this.identityServerType; - cloudIdentityCopy.identityAuthenticationType = this.identityAuthenticationType; - cloudIdentityCopy.projectDomainName = this.projectDomainName; - cloudIdentityCopy.userDomainName = this.userDomainName; - - return cloudIdentityCopy; - } - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", getId()) - .append("identityUrl", getIdentityUrl()).append("msoId", getMsoId()) - .append("projectDomain", getProjectDomainName()).append("userDomain", getUserDomainName()) - .append("adminTenant", getAdminTenant()).append("memberRole", getMemberRole()) - .append("tenantMetadata", getTenantMetadata()).append("identityServerType", getIdentityServerType()) - .append("identityAuthenticationType", getIdentityAuthenticationType()).toString(); - } - - @Override - public boolean equals(final Object other) { - if (other == null) { - return false; - } - if (!getClass().equals(other.getClass())) { - return false; - } - CloudIdentity castOther = (CloudIdentity) other; - return new EqualsBuilder().append(getId(), castOther.getId()) - .append(getIdentityUrl(), castOther.getIdentityUrl()).append(getMsoId(), castOther.getMsoId()) - .append(getMsoPass(), castOther.getMsoPass()).append(getAdminTenant(), castOther.getAdminTenant()) - .append(getProjectDomainName(), castOther.getProjectDomainName()).append(getUserDomainName(), castOther.getUserDomainName()) - .append(getMemberRole(), castOther.getMemberRole()) - .append(getTenantMetadata(), castOther.getTenantMetadata()) - .append(getIdentityServerType(), castOther.getIdentityServerType()) - .append(getIdentityAuthenticationType(), castOther.getIdentityAuthenticationType()).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder(1, 31).append(getId()).append(getIdentityUrl()).append(getMsoId()) - .append(getMsoPass()).append(getProjectDomainName()).append(getUserDomainName()).append(getAdminTenant()).append(getMemberRole()).append(getTenantMetadata()) - .append(getIdentityServerType()).append(getIdentityAuthenticationType()).toHashCode(); - } -}
\ No newline at end of file + * @return the identityAuthenticationType + */ + public AuthenticationType getIdentityAuthenticationType() { + return identityAuthenticationType; + } + + /** + * @param identityAuthenticationType the identityAuthenticationType to set + */ + public void setIdentityAuthenticationType(AuthenticationType identityAuthenticationType) { + this.identityAuthenticationType = identityAuthenticationType; + } + + public String getProjectDomainName() { + return projectDomainName; + } + + public void setProjectDomainName(String projectDomainName) { + this.projectDomainName = projectDomainName; + } + + public String getUserDomainName() { + return userDomainName; + } + + public void setUserDomainName(String userDomainName) { + this.userDomainName = userDomainName; + } + + @Override + public CloudIdentity clone() { + CloudIdentity cloudIdentityCopy = new CloudIdentity(); + + cloudIdentityCopy.id = this.id; + cloudIdentityCopy.identityUrl = this.identityUrl; + cloudIdentityCopy.msoId = this.msoId; + cloudIdentityCopy.msoPass = this.msoPass; + cloudIdentityCopy.adminTenant = this.adminTenant; + cloudIdentityCopy.memberRole = this.memberRole; + cloudIdentityCopy.tenantMetadata = this.tenantMetadata; + cloudIdentityCopy.identityServerType = this.identityServerType; + cloudIdentityCopy.identityAuthenticationType = this.identityAuthenticationType; + cloudIdentityCopy.projectDomainName = this.projectDomainName; + cloudIdentityCopy.userDomainName = this.userDomainName; + + return cloudIdentityCopy; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", getId()) + .append("identityUrl", getIdentityUrl()).append("msoId", getMsoId()) + .append("projectDomain", getProjectDomainName()).append("userDomain", getUserDomainName()) + .append("adminTenant", getAdminTenant()).append("memberRole", getMemberRole()) + .append("tenantMetadata", getTenantMetadata()).append("identityServerType", getIdentityServerType()) + .append("identityAuthenticationType", getIdentityAuthenticationType()).toString(); + } + + @Override + public boolean equals(final Object other) { + if (other == null) { + return false; + } + if (!getClass().equals(other.getClass())) { + return false; + } + CloudIdentity castOther = (CloudIdentity) other; + return new EqualsBuilder().append(getId(), castOther.getId()) + .append(getIdentityUrl(), castOther.getIdentityUrl()).append(getMsoId(), castOther.getMsoId()) + .append(getMsoPass(), castOther.getMsoPass()).append(getAdminTenant(), castOther.getAdminTenant()) + .append(getProjectDomainName(), castOther.getProjectDomainName()) + .append(getUserDomainName(), castOther.getUserDomainName()) + .append(getMemberRole(), castOther.getMemberRole()) + .append(getTenantMetadata(), castOther.getTenantMetadata()) + .append(getIdentityServerType(), castOther.getIdentityServerType()) + .append(getIdentityAuthenticationType(), castOther.getIdentityAuthenticationType()).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(1, 31).append(getId()).append(getIdentityUrl()).append(getMsoId()) + .append(getMsoPass()).append(getProjectDomainName()).append(getUserDomainName()) + .append(getAdminTenant()).append(getMemberRole()).append(getTenantMetadata()) + .append(getIdentityServerType()).append(getIdentityAuthenticationType()).toHashCode(); + } +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java index 433ae986ab..053bf745e1 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudSite.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.net.URI; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -36,24 +35,20 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; import javax.persistence.Transient; - import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; - import com.fasterxml.jackson.annotation.JsonAutoDetect; import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility; import com.fasterxml.jackson.annotation.JsonProperty; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.RemoteResource; import uk.co.blackpepper.bowman.annotation.ResourceId; /** - * EntityBean class for a CloudSite. This bean represents a cloud location - * (i.e. and LCP node) in the NVP/AIC cloud. It will be loaded via CloudConfig - * object, of which it is a component + * EntityBean class for a CloudSite. This bean represents a cloud location (i.e. and LCP node) in the NVP/AIC cloud. It + * will be loaded via CloudConfig object, of which it is a component * */ @RemoteResource("/cloudSite") @@ -111,7 +106,7 @@ public class CloudSite { @JsonProperty("last_updated_by") @BusinessKey @Column(name = "LAST_UPDATED_BY") - private String lastUpdatedBy ; + private String lastUpdatedBy; @JsonProperty("creation_timestamp") @BusinessKey @@ -159,10 +154,12 @@ public class CloudSite { } @ResourceId - public URI getUri() {return this.uri;} + public URI getUri() { + return this.uri; + } public void setUri(URI uri) { - this.uri = uri; + this.uri = uri; } public String getRegionId() { @@ -174,7 +171,8 @@ public class CloudSite { } public String getIdentityServiceId() { - return identityServiceId == null ? (identityService== null? null:identityService.getId()):identityServiceId; + return identityServiceId == null ? (identityService == null ? null : identityService.getId()) + : identityServiceId; } public String getCloudVersion() { @@ -241,13 +239,14 @@ public class CloudSite { this.orchestrator = orchestrator; } - public CloudIdentity getIdentityService () { + public CloudIdentity getIdentityService() { return identityService; } - public void setIdentityService (CloudIdentity identity) { + public void setIdentityService(CloudIdentity identity) { this.identityService = identity; } + @Deprecated public void setIdentityServiceId(String identityServiceId) { this.identityServiceId = identityServiceId; @@ -272,7 +271,8 @@ public class CloudSite { CloudSite castOther = (CloudSite) other; return new EqualsBuilder().append(getRegionId(), castOther.getRegionId()) .append(getIdentityServiceId(), castOther.getIdentityServiceId()) - .append(getCloudVersion(), castOther.getCloudVersion()).append(getClli(), castOther.getClli()).isEquals(); + .append(getCloudVersion(), castOther.getCloudVersion()).append(getClli(), castOther.getClli()) + .isEquals(); } @Override diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudifyManager.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudifyManager.java index 30ebca8699..a3df245ae6 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudifyManager.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CloudifyManager.java @@ -21,15 +21,12 @@ package org.onap.so.db.catalog.beans; import java.util.Date; - import com.fasterxml.jackson.annotation.JsonProperty; import com.openpojo.business.annotation.BusinessKey; - import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.EqualsBuilder; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -39,11 +36,9 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; /** - * EntityBean class for a Cloudify Manager. This bean represents a Cloudify - * node through which TOSCA-based VNFs may be deployed. Each CloudSite in the - * CloudConfig may have a Cloudify Manager for deployments using TOSCA blueprints. - * Cloudify Managers may support multiple Cloud Sites, but each site will have - * at most one Cloudify Manager. + * EntityBean class for a Cloudify Manager. This bean represents a Cloudify node through which TOSCA-based VNFs may be + * deployed. Each CloudSite in the CloudConfig may have a Cloudify Manager for deployments using TOSCA blueprints. + * Cloudify Managers may support multiple Cloud Sites, but each site will have at most one Cloudify Manager. * * This does not replace the ability to use the CloudSite directly via Openstack. * @@ -52,156 +47,157 @@ import javax.persistence.TemporalType; @Entity @Table(name = "cloudify_managers") public class CloudifyManager { - - @JsonProperty - @BusinessKey - @Id - @Column(name = "ID") - private String id; - - @BusinessKey - @JsonProperty ("cloudify_url") - @Column(name = "CLOUDIFY_URL") - private String cloudifyUrl; - - @BusinessKey - @JsonProperty("username") - @Column(name = "USERNAME") - private String username; - - @BusinessKey - @JsonProperty("password") - @Column(name = "PASSWORD") - private String password; - - @BusinessKey - @JsonProperty("version") - @Column(name = "VERSION") - private String version; - - @JsonProperty("last_updated_by") - @BusinessKey - @Column(name = "LAST_UPDATED_BY") - private String lastUpdatedBy ; - - @JsonProperty("creation_timestamp") - @BusinessKey - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @JsonProperty("update_timestamp") - @BusinessKey - @Column(name = "UPDATE_TIMESTAMP") - @Temporal(TemporalType.TIMESTAMP) - private Date updated; - - public CloudifyManager() {} - - @PrePersist - protected void onCreate() { - this.created = new Date(); - this.updated = new Date(); - } - - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - - public String getCloudifyUrl() { - return cloudifyUrl; - } - - public void setCloudifyUrl(String cloudifyUrl) { - this.cloudifyUrl = cloudifyUrl; - } - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { + + @JsonProperty + @BusinessKey + @Id + @Column(name = "ID") + private String id; + + @BusinessKey + @JsonProperty("cloudify_url") + @Column(name = "CLOUDIFY_URL") + private String cloudifyUrl; + + @BusinessKey + @JsonProperty("username") + @Column(name = "USERNAME") + private String username; + + @BusinessKey + @JsonProperty("password") + @Column(name = "PASSWORD") + private String password; + + @BusinessKey + @JsonProperty("version") + @Column(name = "VERSION") + private String version; + + @JsonProperty("last_updated_by") + @BusinessKey + @Column(name = "LAST_UPDATED_BY") + private String lastUpdatedBy; + + @JsonProperty("creation_timestamp") + @BusinessKey + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @JsonProperty("update_timestamp") + @BusinessKey + @Column(name = "UPDATE_TIMESTAMP") + @Temporal(TemporalType.TIMESTAMP) + private Date updated; + + public CloudifyManager() {} + + @PrePersist + protected void onCreate() { + this.created = new Date(); + this.updated = new Date(); + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getCloudifyUrl() { + return cloudifyUrl; + } + + public void setCloudifyUrl(String cloudifyUrl) { + this.cloudifyUrl = cloudifyUrl; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getLastUpdatedBy() { - return lastUpdatedBy; - } - - public Date getCreated() { - return created; - } - - public Date getUpdated() { - return updated; - } - - public void setLastUpdatedBy(String lastUpdatedBy) { - this.lastUpdatedBy = lastUpdatedBy; - } - - public void setCreated(Date created) { - this.created = created; - } - - public void setUpdated(Date updated) { - this.updated = updated; - } - - @Override - public CloudifyManager clone() { - CloudifyManager cloudifyManagerCopy = new CloudifyManager(); - cloudifyManagerCopy.id = this.id; - cloudifyManagerCopy.cloudifyUrl = this.cloudifyUrl; - cloudifyManagerCopy.username = this.username; - cloudifyManagerCopy.password = this.password; - cloudifyManagerCopy.version = this.version; - return cloudifyManagerCopy; - } - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", getId()) - .append("cloudifyUrl", getCloudifyUrl()).append("username", getUsername()) - .append("password", getPassword()).append("version", getVersion()).toString(); - } - - @Override - public boolean equals(final Object other) { - if (other == null) { - return false; - } - if (!getClass().equals(other.getClass())) { - return false; - } - CloudifyManager castOther = (CloudifyManager) other; - return new EqualsBuilder().append(getId(), castOther.getId()) - .append(getCloudifyUrl(), castOther.getCloudifyUrl()).append(getUsername(), castOther.getUsername()) - .append(getPassword(), castOther.getPassword()).append(getVersion(), castOther.getVersion()).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder(1, 31).append(getId()).append(getCloudifyUrl()).append(getUsername()) - .append(getPassword()).append(getVersion()).toHashCode(); - } + } + + public void setPassword(String password) { + this.password = password; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getLastUpdatedBy() { + return lastUpdatedBy; + } + + public Date getCreated() { + return created; + } + + public Date getUpdated() { + return updated; + } + + public void setLastUpdatedBy(String lastUpdatedBy) { + this.lastUpdatedBy = lastUpdatedBy; + } + + public void setCreated(Date created) { + this.created = created; + } + + public void setUpdated(Date updated) { + this.updated = updated; + } + + @Override + public CloudifyManager clone() { + CloudifyManager cloudifyManagerCopy = new CloudifyManager(); + cloudifyManagerCopy.id = this.id; + cloudifyManagerCopy.cloudifyUrl = this.cloudifyUrl; + cloudifyManagerCopy.username = this.username; + cloudifyManagerCopy.password = this.password; + cloudifyManagerCopy.version = this.version; + return cloudifyManagerCopy; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("id", getId()) + .append("cloudifyUrl", getCloudifyUrl()).append("username", getUsername()) + .append("password", getPassword()).append("version", getVersion()).toString(); + } + + @Override + public boolean equals(final Object other) { + if (other == null) { + return false; + } + if (!getClass().equals(other.getClass())) { + return false; + } + CloudifyManager castOther = (CloudifyManager) other; + return new EqualsBuilder().append(getId(), castOther.getId()) + .append(getCloudifyUrl(), castOther.getCloudifyUrl()).append(getUsername(), castOther.getUsername()) + .append(getPassword(), castOther.getPassword()).append(getVersion(), castOther.getVersion()).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(1, 31).append(getId()).append(getCloudifyUrl()).append(getUsername()) + .append(getPassword()).append(getVersion()).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionNetworkResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionNetworkResourceCustomization.java index d4de5cbcdf..566268ba57 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionNetworkResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionNetworkResourceCustomization.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,175 +33,172 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "collection_network_resource_customization") public class CollectionNetworkResourceCustomization implements Serializable { - /** - * - */ - private static final long serialVersionUID = 11115611315801079L; - - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID = null; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @BusinessKey - @Column(name = "NETWORK_TECHNOLOGY") - private String networkTechnology; - - @BusinessKey - @Column(name = "NETWORK_TYPE") - private String networkType = null; - - @BusinessKey - @Column(name = "NETWORK_SCOPE") - private String networkScope; - - @BusinessKey - @Column(name = "NETWORK_ROLE") - private String networkRole; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID") - private NetworkResource networkResource = null; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID") - private InstanceGroup instanceGroup = null; - - @BusinessKey - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "CRC_MODEL_CUSTOMIZATION_UUID") - private NetworkCollectionResourceCustomization networkResourceCustomization = null; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof CollectionNetworkResourceCustomization)) { - return false; - } - CollectionNetworkResourceCustomization castOther = (CollectionNetworkResourceCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID) - .append(networkTechnology, castOther.networkTechnology).append(networkType, castOther.networkType) - .append(networkScope, castOther.networkScope).append(networkRole, castOther.networkRole) - .append(networkResourceCustomization, castOther.networkResourceCustomization).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).append(networkTechnology).append(networkType) - .append(networkScope).append(networkRole).append(networkResourceCustomization).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("created", created) - .append("networkTechnology", networkTechnology).append("networkType", networkType) - .append("networkScope", networkScope).append("networkRole", networkRole) - .append("networkResource", networkResource).append("collectionResource", networkResourceCustomization) - .toString(); - } - - public String getModelCustomizationUUID() { - return this.modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - @LinkedResource - public NetworkCollectionResourceCustomization getNetworkResourceCustomization() { - return networkResourceCustomization; - } - - public void setNetworkResourceCustomization(NetworkCollectionResourceCustomization networkResourceCustomization) { - this.networkResourceCustomization = networkResourceCustomization; - } - - public String getModelInstanceName() { - return this.modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - @LinkedResource - public NetworkResource getNetworkResource() { - return this.networkResource; - } - - public void setNetworkResource(NetworkResource networkResource) { - this.networkResource = networkResource; - } - - public String getNetworkType() { - return this.networkType; - } - - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - - public Date getCreated() { - return this.created; - } - - public String getNetworkTechnology() { - return this.networkTechnology; - } - - public void setNetworkTechnology(String networkTechnology) { - this.networkTechnology = networkTechnology; - } - - public String getNetworkScope() { - return this.networkScope; - } - - public void setNetworkScope(String networkScope) { - this.networkScope = networkScope; - } - - public void setNetworkRole(String networkRole) { - this.networkRole = networkRole; - } - - public String getNetworkRole() { - return this.networkRole; - } - - @LinkedResource - public InstanceGroup getInstanceGroup() { - return instanceGroup; - } - - public void setInstanceGroup(InstanceGroup instanceGroup) { - this.instanceGroup = instanceGroup; - } - + /** + * + */ + private static final long serialVersionUID = 11115611315801079L; + + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID = null; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @BusinessKey + @Column(name = "NETWORK_TECHNOLOGY") + private String networkTechnology; + + @BusinessKey + @Column(name = "NETWORK_TYPE") + private String networkType = null; + + @BusinessKey + @Column(name = "NETWORK_SCOPE") + private String networkScope; + + @BusinessKey + @Column(name = "NETWORK_ROLE") + private String networkRole; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID") + private NetworkResource networkResource = null; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID") + private InstanceGroup instanceGroup = null; + + @BusinessKey + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "CRC_MODEL_CUSTOMIZATION_UUID") + private NetworkCollectionResourceCustomization networkResourceCustomization = null; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof CollectionNetworkResourceCustomization)) { + return false; + } + CollectionNetworkResourceCustomization castOther = (CollectionNetworkResourceCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID) + .append(networkTechnology, castOther.networkTechnology).append(networkType, castOther.networkType) + .append(networkScope, castOther.networkScope).append(networkRole, castOther.networkRole) + .append(networkResourceCustomization, castOther.networkResourceCustomization).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).append(networkTechnology).append(networkType) + .append(networkScope).append(networkRole).append(networkResourceCustomization).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("created", created) + .append("networkTechnology", networkTechnology).append("networkType", networkType) + .append("networkScope", networkScope).append("networkRole", networkRole) + .append("networkResource", networkResource).append("collectionResource", networkResourceCustomization) + .toString(); + } + + public String getModelCustomizationUUID() { + return this.modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + @LinkedResource + public NetworkCollectionResourceCustomization getNetworkResourceCustomization() { + return networkResourceCustomization; + } + + public void setNetworkResourceCustomization(NetworkCollectionResourceCustomization networkResourceCustomization) { + this.networkResourceCustomization = networkResourceCustomization; + } + + public String getModelInstanceName() { + return this.modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + @LinkedResource + public NetworkResource getNetworkResource() { + return this.networkResource; + } + + public void setNetworkResource(NetworkResource networkResource) { + this.networkResource = networkResource; + } + + public String getNetworkType() { + return this.networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public Date getCreated() { + return this.created; + } + + public String getNetworkTechnology() { + return this.networkTechnology; + } + + public void setNetworkTechnology(String networkTechnology) { + this.networkTechnology = networkTechnology; + } + + public String getNetworkScope() { + return this.networkScope; + } + + public void setNetworkScope(String networkScope) { + this.networkScope = networkScope; + } + + public void setNetworkRole(String networkRole) { + this.networkRole = networkRole; + } + + public String getNetworkRole() { + return this.networkRole; + } + + @LinkedResource + public InstanceGroup getInstanceGroup() { + return instanceGroup; + } + + public void setInstanceGroup(InstanceGroup instanceGroup) { + this.instanceGroup = instanceGroup; + } + } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResource.java index f8148aa781..9a92d0a64f 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResource.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResource.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,148 +33,145 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "collection_resource") public class CollectionResource implements Serializable { - /** - * - */ - private static final long serialVersionUID = -8612818857960992110L; + /** + * + */ + private static final long serialVersionUID = -8612818857960992110L; - @BusinessKey - @Id - @Column(name = "MODEL_UUID") - private String modelUUID; + @BusinessKey + @Id + @Column(name = "MODEL_UUID") + private String modelUUID; - @Column(name = "MODEL_NAME") - private String modelName; + @Column(name = "MODEL_NAME") + private String modelName; - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; - @Column(name = "DESCRIPTION") - private String description; + @Column(name = "DESCRIPTION") + private String description; - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "collectionResource") - private Set<CollectionResourceCustomization> collectionResourceCustomization; - - @OneToOne(cascade = CascadeType.ALL, mappedBy = "collectionResource") - private InstanceGroup instanceGroup; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof CollectionResource)) { - return false; - } - CollectionResource castOther = (CollectionResource) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } - - public Set<CollectionResourceCustomization> getCollectionResourceCustomization() { - return collectionResourceCustomization; - } - - public void setCollectionResourceCustomization( - Set<CollectionResourceCustomization> collectionResourceCustomization) { - this.collectionResourceCustomization = collectionResourceCustomization; - } - - public String getModelUUID() { - return modelUUID; - } - - public Date getCreated() { - return this.created; - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - @LinkedResource - public InstanceGroup getInstanceGroup() { - return instanceGroup; - } - - public void setInstanceGroup(InstanceGroup instanceGroup) { - this.instanceGroup = instanceGroup; - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelName", modelName) - .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) - .append("toscaNodeType", toscaNodeType).append("description", description).append("created", created) - .toString(); - } -}
\ No newline at end of file + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "collectionResource") + private Set<CollectionResourceCustomization> collectionResourceCustomization; + + @OneToOne(cascade = CascadeType.ALL, mappedBy = "collectionResource") + private InstanceGroup instanceGroup; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof CollectionResource)) { + return false; + } + CollectionResource castOther = (CollectionResource) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } + + public Set<CollectionResourceCustomization> getCollectionResourceCustomization() { + return collectionResourceCustomization; + } + + public void setCollectionResourceCustomization( + Set<CollectionResourceCustomization> collectionResourceCustomization) { + this.collectionResourceCustomization = collectionResourceCustomization; + } + + public String getModelUUID() { + return modelUUID; + } + + public Date getCreated() { + return this.created; + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + @LinkedResource + public InstanceGroup getInstanceGroup() { + return instanceGroup; + } + + public void setInstanceGroup(InstanceGroup instanceGroup) { + this.instanceGroup = instanceGroup; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelName", modelName) + .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) + .append("toscaNodeType", toscaNodeType).append("description", description).append("created", created) + .toString(); + } +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceCustomization.java index 34389de22f..8214c0a074 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceCustomization.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.DiscriminatorColumn; @@ -39,13 +38,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @@ -54,127 +50,127 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "collection_resource_customization") public class CollectionResourceCustomization implements Serializable { - /** - * - */ - private static final long serialVersionUID = -8328823396870652841L; - - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "COLLECTION_RESOURCE_TYPE") - private String type; - - @Column(name = "ROLE") - private String role; - - @Column(name = "FUNCTION") - private String function; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "CR_MODEL_UUID") - private CollectionResource collectionResource; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "collectionResourceCust") - private List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("type", type).append("role", role) - .append("function", function).append("created", created) - .append("collectionResource", collectionResource) - .append("collectionInstanceGroupCustomizations", collectionInstanceGroupCustomizations).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof CollectionResourceCustomization)) { - return false; - } - CollectionResourceCustomization castOther = (CollectionResourceCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); - } - - public Date getCreated() { - return this.created; - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getRole() { - return role; - } - - public void setRole(String role) { - this.role = role; - } - - public String getFunction() { - return function; - } - - public void setFunction(String function) { - this.function = function; - } - - @LinkedResource - public CollectionResource getCollectionResource() { - return collectionResource; - } - - public void setCollectionResource(CollectionResource collectionResource) { - this.collectionResource = collectionResource; - } - - @LinkedResource - public List<CollectionResourceInstanceGroupCustomization> getCollectionInstanceGroupCustomizations() { - return collectionInstanceGroupCustomizations; - } - - public void setCollectionInstanceGroupCustomizations( - List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations) { - this.collectionInstanceGroupCustomizations = collectionInstanceGroupCustomizations; - } -}
\ No newline at end of file + /** + * + */ + private static final long serialVersionUID = -8328823396870652841L; + + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "COLLECTION_RESOURCE_TYPE") + private String type; + + @Column(name = "ROLE") + private String role; + + @Column(name = "FUNCTION") + private String function; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "CR_MODEL_UUID") + private CollectionResource collectionResource; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "collectionResourceCust") + private List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("type", type).append("role", role) + .append("function", function).append("created", created) + .append("collectionResource", collectionResource) + .append("collectionInstanceGroupCustomizations", collectionInstanceGroupCustomizations).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof CollectionResourceCustomization)) { + return false; + } + CollectionResourceCustomization castOther = (CollectionResourceCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); + } + + public Date getCreated() { + return this.created; + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public String getFunction() { + return function; + } + + public void setFunction(String function) { + this.function = function; + } + + @LinkedResource + public CollectionResource getCollectionResource() { + return collectionResource; + } + + public void setCollectionResource(CollectionResource collectionResource) { + this.collectionResource = collectionResource; + } + + @LinkedResource + public List<CollectionResourceInstanceGroupCustomization> getCollectionInstanceGroupCustomizations() { + return collectionInstanceGroupCustomizations; + } + + public void setCollectionInstanceGroupCustomizations( + List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations) { + this.collectionInstanceGroupCustomizations = collectionInstanceGroupCustomizations; + } +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomization.java index 7379225a34..4a72f9a3c2 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomization.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -35,13 +34,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @@ -49,132 +45,132 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "collection_resource_instance_group_customization") public class CollectionResourceInstanceGroupCustomization implements Serializable { - /** - * - */ - private static final long serialVersionUID = 5169990063225044265L; - - @BusinessKey - @Id - @Column(name = "COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID") - private String modelCustomizationUUID; - - @BusinessKey - @Id - @Column(name = "INSTANCE_GROUP_MODEL_UUID") - private String modelUUID; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID", updatable = false, insertable = false) - private CollectionResourceCustomization collectionResourceCust; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID", updatable = false, insertable = false) - private InstanceGroup instanceGroup; - - @Column(name = "FUNCTION") - private String function; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @Column(name = "SUBINTERFACE_NETWORK_QUANTITY") - private Integer subInterfaceNetworkQuantity; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelUUID", modelUUID).append("collectionResourceCust", collectionResourceCust) - .append("instanceGroup", instanceGroup).append("function", function).append("description", description) - .append("created", created).append("subInterfaceNetworkQuantity", subInterfaceNetworkQuantity) - .toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof CollectionResourceInstanceGroupCustomization)) { - return false; - } - CollectionResourceInstanceGroupCustomization castOther = (CollectionResourceInstanceGroupCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID) - .append(modelUUID, castOther.modelUUID).append(collectionResourceCust, castOther.collectionResourceCust) - .append(instanceGroup, castOther.instanceGroup).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).append(modelUUID).append(collectionResourceCust) - .append(instanceGroup).toHashCode(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getFunction() { - return function; - } - - public void setFunction(String function) { - this.function = function; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } - - public Integer getSubInterfaceNetworkQuantity() { - return subInterfaceNetworkQuantity; - } - - public void setSubInterfaceNetworkQuantity(Integer subInterfaceNetworkQuantity) { - this.subInterfaceNetworkQuantity = subInterfaceNetworkQuantity; - } - - @LinkedResource - public CollectionResourceCustomization getCollectionResourceCust() { - return collectionResourceCust; - } - - public void setCollectionResourceCust(CollectionResourceCustomization collectionResourceCust) { - this.collectionResourceCust = collectionResourceCust; - } - - @LinkedResource - public InstanceGroup getInstanceGroup() { - return instanceGroup; - } - - public void setInstanceGroup(InstanceGroup instanceGroup) { - this.instanceGroup = instanceGroup; - } + /** + * + */ + private static final long serialVersionUID = 5169990063225044265L; + + @BusinessKey + @Id + @Column(name = "COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID") + private String modelCustomizationUUID; + + @BusinessKey + @Id + @Column(name = "INSTANCE_GROUP_MODEL_UUID") + private String modelUUID; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "COLLECTION_RESOURCE_CUSTOMIZATION_MODEL_UUID", updatable = false, insertable = false) + private CollectionResourceCustomization collectionResourceCust; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID", updatable = false, insertable = false) + private InstanceGroup instanceGroup; + + @Column(name = "FUNCTION") + private String function; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @Column(name = "SUBINTERFACE_NETWORK_QUANTITY") + private Integer subInterfaceNetworkQuantity; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelUUID", modelUUID).append("collectionResourceCust", collectionResourceCust) + .append("instanceGroup", instanceGroup).append("function", function).append("description", description) + .append("created", created).append("subInterfaceNetworkQuantity", subInterfaceNetworkQuantity) + .toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof CollectionResourceInstanceGroupCustomization)) { + return false; + } + CollectionResourceInstanceGroupCustomization castOther = (CollectionResourceInstanceGroupCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID) + .append(modelUUID, castOther.modelUUID).append(collectionResourceCust, castOther.collectionResourceCust) + .append(instanceGroup, castOther.instanceGroup).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).append(modelUUID).append(collectionResourceCust) + .append(instanceGroup).toHashCode(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getFunction() { + return function; + } + + public void setFunction(String function) { + this.function = function; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } + + public Integer getSubInterfaceNetworkQuantity() { + return subInterfaceNetworkQuantity; + } + + public void setSubInterfaceNetworkQuantity(Integer subInterfaceNetworkQuantity) { + this.subInterfaceNetworkQuantity = subInterfaceNetworkQuantity; + } + + @LinkedResource + public CollectionResourceCustomization getCollectionResourceCust() { + return collectionResourceCust; + } + + public void setCollectionResourceCust(CollectionResourceCustomization collectionResourceCust) { + this.collectionResourceCust = collectionResourceCust; + } + + @LinkedResource + public InstanceGroup getInstanceGroup() { + return instanceGroup; + } + + public void setInstanceGroup(InstanceGroup instanceGroup) { + this.instanceGroup = instanceGroup; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomizationId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomizationId.java index ff35bdb390..6d5c4109ee 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomizationId.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CollectionResourceInstanceGroupCustomizationId.java @@ -21,58 +21,57 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - 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; public class CollectionResourceInstanceGroupCustomizationId implements Serializable { - /** - * - */ - private static final long serialVersionUID = 7118300524797895317L; + /** + * + */ + private static final long serialVersionUID = 7118300524797895317L; - @BusinessKey - private String modelCustomizationUUID; - @BusinessKey - private String modelUUID; + @BusinessKey + private String modelCustomizationUUID; + @BusinessKey + private String modelUUID; - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelUUID", modelUUID).toString(); - } + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelUUID", modelUUID).toString(); + } - @Override - public boolean equals(final Object other) { - if (!(other instanceof CollectionResourceInstanceGroupCustomizationId)) { - return false; - } - CollectionResourceInstanceGroupCustomizationId castOther = (CollectionResourceInstanceGroupCustomizationId) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID) - .append(modelUUID, castOther.modelUUID).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof CollectionResourceInstanceGroupCustomizationId)) { + return false; + } + CollectionResourceInstanceGroupCustomizationId castOther = + (CollectionResourceInstanceGroupCustomizationId) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID) + .append(modelUUID, castOther.modelUUID).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).append(modelUUID).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).append(modelUUID).toHashCode(); + } - public String getModelCustomizationUUID() { - return this.modelCustomizationUUID; - } + public String getModelCustomizationUUID() { + return this.modelCustomizationUUID; + } - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } - public String getModelUUID() { - return this.modelUUID; - } + public String getModelUUID() { + return this.modelUUID; + } - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResource.java index ccfa71306b..9c2e1de244 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResource.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResource.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -33,151 +32,149 @@ 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 com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; -@JsonIgnoreProperties({ "hibernateLazyInitializer", "handler" }) +@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) @Entity @Table(name = "configuration") public class ConfigurationResource implements Serializable { - /** - * - */ - private static final long serialVersionUID = 6675926401792679171L; + /** + * + */ + private static final long serialVersionUID = 6675926401792679171L; + + @BusinessKey + @Id + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; - @BusinessKey - @Id - @Column(name = "MODEL_UUID") - private String modelUUID; + @Column(name = "MODEL_VERSION") + private String modelVersion; - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "configurationResource") - private Set<ConfigurationResourceCustomization> configurationResourceCustomization; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "configurationResource") - private Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } - - @LinkedResource - public Set<ConfigurationResourceCustomization> getConfigurationResourceCustomization() { - return configurationResourceCustomization; - } - - public void setConfigurationResourceCustomization( - Set<ConfigurationResourceCustomization> configurationResourceCustomization) { - this.configurationResourceCustomization = configurationResourceCustomization; - } - - @LinkedResource - public Set<CvnfcConfigurationCustomization> getCvnfcConfigurationCustomization() { - return cvnfcConfigurationCustomization; - } - - public void setCvnfcConfigurationCustomization(Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization) { - this.cvnfcConfigurationCustomization = cvnfcConfigurationCustomization; - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) - .append("modelVersion", modelVersion).append("modelName", modelName) - .append("toscaNodeType", toscaNodeType).append("description", description).append("created", created) - .append("configurationResourceCustomization", configurationResourceCustomization).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ConfigurationResource)) { - return false; - } - ConfigurationResource castOther = (ConfigurationResource) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "configurationResource") + private Set<ConfigurationResourceCustomization> configurationResourceCustomization; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "configurationResource") + private Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } + + @LinkedResource + public Set<ConfigurationResourceCustomization> getConfigurationResourceCustomization() { + return configurationResourceCustomization; + } + + public void setConfigurationResourceCustomization( + Set<ConfigurationResourceCustomization> configurationResourceCustomization) { + this.configurationResourceCustomization = configurationResourceCustomization; + } + + @LinkedResource + public Set<CvnfcConfigurationCustomization> getCvnfcConfigurationCustomization() { + return cvnfcConfigurationCustomization; + } + + public void setCvnfcConfigurationCustomization( + Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization) { + this.cvnfcConfigurationCustomization = cvnfcConfigurationCustomization; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) + .append("modelVersion", modelVersion).append("modelName", modelName) + .append("toscaNodeType", toscaNodeType).append("description", description).append("created", created) + .append("configurationResourceCustomization", configurationResourceCustomization).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ConfigurationResource)) { + return false; + } + ConfigurationResource castOther = (ConfigurationResource) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResourceCustomization.java index 0b02c11701..059935fff3 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ConfigurationResourceCustomization.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -38,153 +37,150 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "configuration_customization") public class ConfigurationResourceCustomization implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1230671937560638856L; - - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "CONFIGURATION_FUNCTION") - private String nfFunction; - - @Column(name = "CONFIGURATION_TYPE") - private String nfType; - - @Column(name = "CONFIGURATION_ROLE") - private String nfRole; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @Column(name = "SERVICE_PROXY_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID") - private String serviceProxyResourceCustomizationUUID; - - @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "CONFIGURATION_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID") - private ConfigurationResourceCustomization configResourceCustomization; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "CONFIGURATION_MODEL_UUID") - private ConfigurationResource configurationResource; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - public String getNfFunction() { - return nfFunction; - } - - public void setNfFunction(String nfFunction) { - this.nfFunction = nfFunction; - } - - public String getNfType() { - return nfType; - } - - public void setNfType(String nfType) { - this.nfType = nfType; - } - - public String getNfRole() { - return nfRole; - } - - public void setNfRole(String nfRole) { - this.nfRole = nfRole; - } - - public Date getCreated() { - return created; - } - - public String getServiceProxyResourceCustomizationUUID() { - return serviceProxyResourceCustomizationUUID; - } - - public void setServiceProxyResourceCustomizationUUID(String serviceProxyResourceCustomizationUUID) { - this.serviceProxyResourceCustomizationUUID = serviceProxyResourceCustomizationUUID; - } - - @LinkedResource - public ConfigurationResourceCustomization getConfigResourceCustomization() { - return configResourceCustomization; - } - - public void setConfigResourceCustomization(ConfigurationResourceCustomization configResourceCustomization) { - this.configResourceCustomization = configResourceCustomization; - } - - @LinkedResource - public ConfigurationResource getConfigurationResource() { - return configurationResource; - } - - public void setConfigurationResource(ConfigurationResource configurationResource) { - this.configurationResource = configurationResource; - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("nfFunction", nfFunction) - .append("nfType", nfType).append("nfRole", nfRole).append("created", created) - //.append("serviceProxyResourceCustomization", serviceProxyResourceCustomization) - .append("configResourceCustomization", configResourceCustomization) - .append("configurationResource", configurationResource).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ConfigurationResourceCustomization)) { - return false; - } - ConfigurationResourceCustomization castOther = (ConfigurationResourceCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); - } + /** + * + */ + private static final long serialVersionUID = 1230671937560638856L; + + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "CONFIGURATION_FUNCTION") + private String nfFunction; + + @Column(name = "CONFIGURATION_TYPE") + private String nfType; + + @Column(name = "CONFIGURATION_ROLE") + private String nfRole; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @Column(name = "SERVICE_PROXY_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID") + private String serviceProxyResourceCustomizationUUID; + + @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "CONFIGURATION_CUSTOMIZATION_MODEL_CUSTOMIZATION_UUID") + private ConfigurationResourceCustomization configResourceCustomization; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "CONFIGURATION_MODEL_UUID") + private ConfigurationResource configurationResource; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + public String getNfFunction() { + return nfFunction; + } + + public void setNfFunction(String nfFunction) { + this.nfFunction = nfFunction; + } + + public String getNfType() { + return nfType; + } + + public void setNfType(String nfType) { + this.nfType = nfType; + } + + public String getNfRole() { + return nfRole; + } + + public void setNfRole(String nfRole) { + this.nfRole = nfRole; + } + + public Date getCreated() { + return created; + } + + public String getServiceProxyResourceCustomizationUUID() { + return serviceProxyResourceCustomizationUUID; + } + + public void setServiceProxyResourceCustomizationUUID(String serviceProxyResourceCustomizationUUID) { + this.serviceProxyResourceCustomizationUUID = serviceProxyResourceCustomizationUUID; + } + + @LinkedResource + public ConfigurationResourceCustomization getConfigResourceCustomization() { + return configResourceCustomization; + } + + public void setConfigResourceCustomization(ConfigurationResourceCustomization configResourceCustomization) { + this.configResourceCustomization = configResourceCustomization; + } + + @LinkedResource + public ConfigurationResource getConfigurationResource() { + return configurationResource; + } + + public void setConfigurationResource(ConfigurationResource configurationResource) { + this.configurationResource = configurationResource; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("nfFunction", nfFunction) + .append("nfType", nfType).append("nfRole", nfRole).append("created", created) + // .append("serviceProxyResourceCustomization", serviceProxyResourceCustomization) + .append("configResourceCustomization", configResourceCustomization) + .append("configurationResource", configurationResource).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ConfigurationResourceCustomization)) { + return false; + } + ConfigurationResourceCustomization castOther = (ConfigurationResourceCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java index de0dd39edc..425e0b8bbc 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReference.java @@ -20,13 +20,11 @@ package org.onap.so.db.catalog.beans; */ import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; - import com.openpojo.business.annotation.BusinessKey; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -37,70 +35,75 @@ import org.apache.commons.lang3.builder.EqualsBuilder; @Table(name = "CONTROLLER_SELECTION_REFERENCE") public class ControllerSelectionReference implements Serializable { - private static final long serialVersionUID = -608098800737567188L; - - @BusinessKey - @Id - @Column(name = "VNF_TYPE") - private String vnfType; - - @BusinessKey - @Id - @Column(name = "CONTROLLER_NAME") + private static final long serialVersionUID = -608098800737567188L; + + @BusinessKey + @Id + @Column(name = "VNF_TYPE") + private String vnfType; + + @BusinessKey + @Id + @Column(name = "CONTROLLER_NAME") private String controllerName; - - @BusinessKey - @Id - @Column(name = "ACTION_CATEGORY") + + @BusinessKey + @Id + @Column(name = "ACTION_CATEGORY") private String actionCategory; - - public String getVnfType() { - return vnfType; - } - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - public String getControllerName() { - return controllerName; - } - public void setControllerName(String controllerName) { - this.controllerName = controllerName; - } - public String getActionCategory() { - return actionCategory; - } - public void setActionCategory(String actionCategory) { - this.actionCategory = actionCategory; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return new ToStringBuilder(this).append("vnfType", vnfType).append("controllerName", controllerName) - .append("actionCategory", actionCategory).toString(); - } - - /** - * {@inheritDoc} - */ - @Override - public boolean equals(final Object other) { - if (!(other instanceof ControllerSelectionReference)) { - return false; - } - ControllerSelectionReference castOther = (ControllerSelectionReference) other; - return new EqualsBuilder().append(vnfType, castOther.vnfType).append(controllerName, castOther.controllerName) - .append(actionCategory, castOther.actionCategory).isEquals(); - } - - /** - * {@inheritDoc} - */ - @Override - public int hashCode() { - return new HashCodeBuilder().append(vnfType).append(controllerName).append(actionCategory).toHashCode(); - } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getControllerName() { + return controllerName; + } + + public void setControllerName(String controllerName) { + this.controllerName = controllerName; + } + + public String getActionCategory() { + return actionCategory; + } + + public void setActionCategory(String actionCategory) { + this.actionCategory = actionCategory; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return new ToStringBuilder(this).append("vnfType", vnfType).append("controllerName", controllerName) + .append("actionCategory", actionCategory).toString(); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(final Object other) { + if (!(other instanceof ControllerSelectionReference)) { + return false; + } + ControllerSelectionReference castOther = (ControllerSelectionReference) other; + return new EqualsBuilder().append(vnfType, castOther.vnfType).append(controllerName, castOther.controllerName) + .append(actionCategory, castOther.actionCategory).isEquals(); + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return new HashCodeBuilder().append(vnfType).append(controllerName).append(actionCategory).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReferenceId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReferenceId.java index e6ee349be6..f06519c74c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReferenceId.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ControllerSelectionReferenceId.java @@ -21,7 +21,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - import com.openpojo.business.annotation.BusinessKey; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -30,54 +29,59 @@ import org.apache.commons.lang3.builder.EqualsBuilder; public class ControllerSelectionReferenceId implements Serializable { - private static final long serialVersionUID = 1L; - @BusinessKey - private String vnfType; - @BusinessKey + private static final long serialVersionUID = 1L; + @BusinessKey + private String vnfType; + @BusinessKey private String controllerName; - @BusinessKey + @BusinessKey private String actionCategory; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ControllerSelectionReferenceId)) { - return false; - } - ControllerSelectionReferenceId castOther = (ControllerSelectionReferenceId) other; - return new EqualsBuilder().append(vnfType, castOther.vnfType).append(controllerName, castOther.controllerName) - .append(actionCategory, castOther.actionCategory).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(vnfType).append(controllerName).append(actionCategory).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("vnfType", vnfType).append("controllerName", controllerName) - .append("actionCategory", actionCategory).toString(); - } - - public String getVnfType() { - return vnfType; - } - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - public String getControllerName() { - return controllerName; - } - public void setControllerName(String controllerName) { - this.controllerName = controllerName; - } - public String getActionCategory() { - return actionCategory; - } - public void setActionCategory(String actionCategory) { - this.actionCategory = actionCategory; - } - + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ControllerSelectionReferenceId)) { + return false; + } + ControllerSelectionReferenceId castOther = (ControllerSelectionReferenceId) other; + return new EqualsBuilder().append(vnfType, castOther.vnfType).append(controllerName, castOther.controllerName) + .append(actionCategory, castOther.actionCategory).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(vnfType).append(controllerName).append(actionCategory).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("vnfType", vnfType).append("controllerName", controllerName) + .append("actionCategory", actionCategory).toString(); + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getControllerName() { + return controllerName; + } + + public void setControllerName(String controllerName) { + this.controllerName = controllerName; + } + + public String getActionCategory() { + return actionCategory; + } + + public void setActionCategory(String actionCategory) { + this.actionCategory = actionCategory; + } + } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcConfigurationCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcConfigurationCustomization.java index 1e09c6e671..05d43d093c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcConfigurationCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcConfigurationCustomization.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -37,174 +36,172 @@ 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 com.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "cvnfc_configuration_customization") public class CvnfcConfigurationCustomization implements Serializable { - private static final long serialVersionUID = -3153216266280581103L; - - @Id - @BusinessKey - @Column(name = "ID") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "CONFIGURATION_TYPE") - private String configurationType; - - @Column(name = "CONFIGURATION_ROLE") - private String configurationRole; - - @Column(name = "CONFIGURATION_FUNCTION") - private String configurationFunction; - - @Column(name = "POLICY_NAME") - private String policyName; - - @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, fetch = FetchType.LAZY) - @JoinColumn(name = "CONFIGURATION_MODEL_UUID") - private ConfigurationResource configurationResource; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "CVNFC_CUSTOMIZATION_ID") - private CvnfcCustomization cvnfcCustomization; - - - @Override - public boolean equals(final Object other) { - if (!(other instanceof CvnfcConfigurationCustomization)) { - return false; - } - CvnfcConfigurationCustomization castOther = (CvnfcConfigurationCustomization) other; - return new EqualsBuilder().append(id, castOther.id).isEquals(); - } - - - - @Override - public int hashCode() { - return new HashCodeBuilder().append(id).toHashCode(); - } - - - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("configurationType", configurationType) - .append("configurationRole", configurationRole).append("configurationFunction", configurationFunction) - .append("policyName", policyName).append("created", created) - .append("configurationResource", configurationResource).append("cvnfcCustomization", cvnfcCustomization).toString(); - } - - - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - public String getConfigurationType() { - return configurationType; - } - - public void setConfigurationType(String configurationType) { - this.configurationType = configurationType; - } - - public String getConfigurationRole() { - return configurationRole; - } - - public void setConfigurationRole(String configurationRole) { - this.configurationRole = configurationRole; - } - - public String getConfigurationFunction() { - return configurationFunction; - } - - public void setConfigurationFunction(String configurationFunction) { - this.configurationFunction = configurationFunction; - } - - public String getPolicyName() { - return policyName; - } - - public void setPolicyName(String policyName) { - this.policyName = policyName; - } - - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } + private static final long serialVersionUID = -3153216266280581103L; + + @Id + @BusinessKey + @Column(name = "ID") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "CONFIGURATION_TYPE") + private String configurationType; + + @Column(name = "CONFIGURATION_ROLE") + private String configurationRole; + + @Column(name = "CONFIGURATION_FUNCTION") + private String configurationFunction; + + @Column(name = "POLICY_NAME") + private String policyName; + + @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, fetch = FetchType.LAZY) + @JoinColumn(name = "CONFIGURATION_MODEL_UUID") + private ConfigurationResource configurationResource; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "CVNFC_CUSTOMIZATION_ID") + private CvnfcCustomization cvnfcCustomization; + + + @Override + public boolean equals(final Object other) { + if (!(other instanceof CvnfcConfigurationCustomization)) { + return false; + } + CvnfcConfigurationCustomization castOther = (CvnfcConfigurationCustomization) other; + return new EqualsBuilder().append(id, castOther.id).isEquals(); + } + + + + @Override + public int hashCode() { + return new HashCodeBuilder().append(id).toHashCode(); + } + + + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("configurationType", configurationType) + .append("configurationRole", configurationRole).append("configurationFunction", configurationFunction) + .append("policyName", policyName).append("created", created) + .append("configurationResource", configurationResource).append("cvnfcCustomization", cvnfcCustomization) + .toString(); + } + + + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + public String getConfigurationType() { + return configurationType; + } + + public void setConfigurationType(String configurationType) { + this.configurationType = configurationType; + } + + public String getConfigurationRole() { + return configurationRole; + } + + public void setConfigurationRole(String configurationRole) { + this.configurationRole = configurationRole; + } + + public String getConfigurationFunction() { + return configurationFunction; + } + + public void setConfigurationFunction(String configurationFunction) { + this.configurationFunction = configurationFunction; + } + + public String getPolicyName() { + return policyName; + } + + public void setPolicyName(String policyName) { + this.policyName = policyName; + } + + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } + + @LinkedResource + public ConfigurationResource getConfigurationResource() { + return configurationResource; + } + + public void setConfigurationResource(ConfigurationResource configurationResource) { + this.configurationResource = configurationResource; + } - @LinkedResource - public ConfigurationResource getConfigurationResource() { - return configurationResource; - } - - public void setConfigurationResource(ConfigurationResource configurationResource) { - this.configurationResource = configurationResource; - } + @LinkedResource + public CvnfcCustomization getCvnfcCustomization() { + return cvnfcCustomization; + } - @LinkedResource - public CvnfcCustomization getCvnfcCustomization() { - return cvnfcCustomization; - } - - public void setCvnfcCustomization(CvnfcCustomization cvnfcCustomization) { - this.cvnfcCustomization = cvnfcCustomization; - } + public void setCvnfcCustomization(CvnfcCustomization cvnfcCustomization) { + this.cvnfcCustomization = cvnfcCustomization; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java index a7bbb9fb01..da3e391e11 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/CvnfcCustomization.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -38,226 +37,223 @@ 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 com.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "cvnfc_customization") public class CvnfcCustomization implements Serializable { - private static final long serialVersionUID = -3772469944364616486L; - - @Id - @Column(name = "ID") - @BusinessKey - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "NFC_FUNCTION") - private String nfcFunction; - - @Column(name = "NFC_NAMING_CODE") - private String nfcNamingCode; - - @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, fetch = FetchType.LAZY) - @JoinColumn(name = "VF_MODULE_CUSTOMIZATION_ID") - private VfModuleCustomization vfModuleCustomization; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "VNFC_CUST_MODEL_CUSTOMIZATION_UUID") - private VnfcCustomization vnfcCustomization; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "cvnfcCustomization") - private Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof CvnfcCustomization)) { - return false; - } - CvnfcCustomization castOther = (CvnfcCustomization) other; - return new EqualsBuilder().append(id, castOther.id).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(id).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID) - .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) - .append("modelName", modelName).append("toscaNodeType", toscaNodeType) - .append("description", description).append("nfcFunction", nfcFunction) - .append("nfcNamingCode", nfcNamingCode).append("created", created) - .append("vnfVfmoduleCvnfcConfigurationCustomization", cvnfcConfigurationCustomization) - .toString(); - } - - @LinkedResource - public VnfcCustomization getVnfcCustomization() { - return vnfcCustomization; - } - - public void setVnfcCustomization(VnfcCustomization vnfcCustomization) { - this.vnfcCustomization = vnfcCustomization; - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @LinkedResource - public Set<CvnfcConfigurationCustomization> getCvnfcConfigurationCustomization() { - return cvnfcConfigurationCustomization; - } - - public void setCvnfcConfigurationCustomization(Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization) { - this.cvnfcConfigurationCustomization = cvnfcConfigurationCustomization; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getNfcFunction() { - return nfcFunction; - } - - public void setNfcFunction(String nfcFunction) { - this.nfcFunction = nfcFunction; - } - - public String getNfcNamingCode() { - return nfcNamingCode; - } - - public void setNfcNamingCode(String nfcNamingCode) { - this.nfcNamingCode = nfcNamingCode; - } - - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } - - @LinkedResource - public VfModuleCustomization getVfModuleCustomization() { - return vfModuleCustomization; - } - - public void setVfModuleCustomization(VfModuleCustomization vfModuleCustomization) { - this.vfModuleCustomization = vfModuleCustomization; - } + private static final long serialVersionUID = -3772469944364616486L; + + @Id + @Column(name = "ID") + @BusinessKey + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "NFC_FUNCTION") + private String nfcFunction; + + @Column(name = "NFC_NAMING_CODE") + private String nfcNamingCode; + + @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, fetch = FetchType.LAZY) + @JoinColumn(name = "VF_MODULE_CUSTOMIZATION_ID") + private VfModuleCustomization vfModuleCustomization; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "VNFC_CUST_MODEL_CUSTOMIZATION_UUID") + private VnfcCustomization vnfcCustomization; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "cvnfcCustomization") + private Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof CvnfcCustomization)) { + return false; + } + CvnfcCustomization castOther = (CvnfcCustomization) other; + return new EqualsBuilder().append(id, castOther.id).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(id).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID) + .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) + .append("modelName", modelName).append("toscaNodeType", toscaNodeType) + .append("description", description).append("nfcFunction", nfcFunction) + .append("nfcNamingCode", nfcNamingCode).append("created", created) + .append("vnfVfmoduleCvnfcConfigurationCustomization", cvnfcConfigurationCustomization).toString(); + } + + @LinkedResource + public VnfcCustomization getVnfcCustomization() { + return vnfcCustomization; + } + + public void setVnfcCustomization(VnfcCustomization vnfcCustomization) { + this.vnfcCustomization = vnfcCustomization; + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @LinkedResource + public Set<CvnfcConfigurationCustomization> getCvnfcConfigurationCustomization() { + return cvnfcConfigurationCustomization; + } + + public void setCvnfcConfigurationCustomization( + Set<CvnfcConfigurationCustomization> cvnfcConfigurationCustomization) { + this.cvnfcConfigurationCustomization = cvnfcConfigurationCustomization; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getNfcFunction() { + return nfcFunction; + } + + public void setNfcFunction(String nfcFunction) { + this.nfcFunction = nfcFunction; + } + + public String getNfcNamingCode() { + return nfcNamingCode; + } + + public void setNfcNamingCode(String nfcNamingCode) { + this.nfcNamingCode = nfcNamingCode; + } + + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } + + @LinkedResource + public VfModuleCustomization getVfModuleCustomization() { + return vfModuleCustomization; + } + + public void setVfModuleCustomization(VfModuleCustomization vfModuleCustomization) { + this.vfModuleCustomization = vfModuleCustomization; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ExternalServiceToInternalService.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ExternalServiceToInternalService.java index d076aebf86..f664e79702 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ExternalServiceToInternalService.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ExternalServiceToInternalService.java @@ -21,112 +21,109 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; 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; @Entity @Table(name = "external_service_to_internal_model_mapping") public class ExternalServiceToInternalService implements Serializable { - /** - * - */ - private static final long serialVersionUID = 3825246668050173010L; - - @Id - @Column(name = "Id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @BusinessKey - @Column(name = "SERVICE_NAME") - private String serviceName; - - @BusinessKey - @Column(name = "PRODUCT_FLAVOR") - private String productFlavor; - - @BusinessKey - @Column(name = "SUBSCRIPTION_SERVICE_TYPE") - private String subscriptionServiceType; - - @BusinessKey - @Column(name = "SERVICE_MODEL_UUID") - private String serviceModelUUID; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ExternalServiceToInternalService)) { - return false; - } - ExternalServiceToInternalService castOther = (ExternalServiceToInternalService) other; - return new EqualsBuilder().append(serviceName, castOther.serviceName) - .append(productFlavor, castOther.productFlavor) - .append(subscriptionServiceType, castOther.subscriptionServiceType) - .append(serviceModelUUID, castOther.serviceModelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(serviceName).append(productFlavor).append(subscriptionServiceType) - .append(serviceModelUUID).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("serviceName", serviceName) - .append("productFlavor", productFlavor).append("subscriptionServiceType", subscriptionServiceType) - .append("serviceModelUUID", serviceModelUUID).toString(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getServiceName() { - return serviceName; - } - - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - - public String getProductFlavor() { - return productFlavor; - } - - public void setProductFlavor(String productFlavor) { - this.productFlavor = productFlavor; - } - - public String getSubscriptionServiceType() { - return subscriptionServiceType; - } - - public void setSubscriptionServiceType(String subscriptionServiceType) { - this.subscriptionServiceType = subscriptionServiceType; - } - - public String getServiceModelUUID() { - return serviceModelUUID; - } - - public void setServiceModelUUID(String serviceModelUUID) { - this.serviceModelUUID = serviceModelUUID; - } + /** + * + */ + private static final long serialVersionUID = 3825246668050173010L; + + @Id + @Column(name = "Id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @BusinessKey + @Column(name = "SERVICE_NAME") + private String serviceName; + + @BusinessKey + @Column(name = "PRODUCT_FLAVOR") + private String productFlavor; + + @BusinessKey + @Column(name = "SUBSCRIPTION_SERVICE_TYPE") + private String subscriptionServiceType; + + @BusinessKey + @Column(name = "SERVICE_MODEL_UUID") + private String serviceModelUUID; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ExternalServiceToInternalService)) { + return false; + } + ExternalServiceToInternalService castOther = (ExternalServiceToInternalService) other; + return new EqualsBuilder().append(serviceName, castOther.serviceName) + .append(productFlavor, castOther.productFlavor) + .append(subscriptionServiceType, castOther.subscriptionServiceType) + .append(serviceModelUUID, castOther.serviceModelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(serviceName).append(productFlavor).append(subscriptionServiceType) + .append(serviceModelUUID).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("serviceName", serviceName) + .append("productFlavor", productFlavor).append("subscriptionServiceType", subscriptionServiceType) + .append("serviceModelUUID", serviceModelUUID).toString(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getServiceName() { + return serviceName; + } + + public void setServiceName(String serviceName) { + this.serviceName = serviceName; + } + + public String getProductFlavor() { + return productFlavor; + } + + public void setProductFlavor(String productFlavor) { + this.productFlavor = productFlavor; + } + + public String getSubscriptionServiceType() { + return subscriptionServiceType; + } + + public void setSubscriptionServiceType(String subscriptionServiceType) { + this.subscriptionServiceType = subscriptionServiceType; + } + + public String getServiceModelUUID() { + return serviceModelUUID; + } + + public void setServiceModelUUID(String serviceModelUUID) { + this.serviceModelUUID = serviceModelUUID; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatEnvironment.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatEnvironment.java index 6abe8d5110..511f7cf709 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatEnvironment.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatEnvironment.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.text.DateFormat; import java.util.Date; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -32,132 +31,130 @@ 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 com.openpojo.business.annotation.BusinessKey; @Entity @Table(name = "heat_environment") public class HeatEnvironment implements Serializable { - private static final long serialVersionUID = 768026109321305392L; + private static final long serialVersionUID = 768026109321305392L; - @BusinessKey - @Id - @Column(name = "ARTIFACT_UUID") - private String artifactUuid; - - @Column(name = "NAME") - private String name = null; - - @Column(name = "DESCRIPTION") - private String description = null; - - @Lob - @Column(name = "BODY", columnDefinition = "LONGTEXT") - private String environment = null; - - @Column(name = "ARTIFACT_CHECKSUM") - private String artifactChecksum; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @BusinessKey - @Column(name = "VERSION") - private String version; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof HeatEnvironment)) { - return false; - } - HeatEnvironment castOther = (HeatEnvironment) other; - return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).append(version, castOther.version) - .isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(artifactUuid).append(version).toHashCode(); - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getArtifactUuid() { - return this.artifactUuid; - } - - public void setArtifactUuid(String artifactUuid) { - this.artifactUuid = artifactUuid; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDescription() { - return this.description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getEnvironment() { - return this.environment; - } - - public void setEnvironment(String environment) { - this.environment = environment; - } - - public String getArtifactChecksum() { - return artifactChecksum; - } - - public void setArtifactChecksum(String artifactChecksum) { - this.artifactChecksum = artifactChecksum; - } - - public Date getCreated() { - return created; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("Artifact UUID=" + this.artifactUuid); - sb.append(", name="); - sb.append(name); - sb.append(", version="); - sb.append(version); - sb.append(", description="); - sb.append(this.description == null ? "null" : this.description); - sb.append(", body="); - sb.append(this.environment == null ? "null" : this.environment); - if (this.created != null) { - sb.append(",creationTimestamp="); - sb.append(DateFormat.getInstance().format(this.created)); - } - return sb.toString(); - } + @BusinessKey + @Id + @Column(name = "ARTIFACT_UUID") + private String artifactUuid; + + @Column(name = "NAME") + private String name = null; + + @Column(name = "DESCRIPTION") + private String description = null; + + @Lob + @Column(name = "BODY", columnDefinition = "LONGTEXT") + private String environment = null; + + @Column(name = "ARTIFACT_CHECKSUM") + private String artifactChecksum; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @BusinessKey + @Column(name = "VERSION") + private String version; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof HeatEnvironment)) { + return false; + } + HeatEnvironment castOther = (HeatEnvironment) other; + return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).append(version, castOther.version) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(artifactUuid).append(version).toHashCode(); + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getArtifactUuid() { + return this.artifactUuid; + } + + public void setArtifactUuid(String artifactUuid) { + this.artifactUuid = artifactUuid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getEnvironment() { + return this.environment; + } + + public void setEnvironment(String environment) { + this.environment = environment; + } + + public String getArtifactChecksum() { + return artifactChecksum; + } + + public void setArtifactChecksum(String artifactChecksum) { + this.artifactChecksum = artifactChecksum; + } + + public Date getCreated() { + return created; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Artifact UUID=" + this.artifactUuid); + sb.append(", name="); + sb.append(name); + sb.append(", version="); + sb.append(version); + sb.append(", description="); + sb.append(this.description == null ? "null" : this.description); + sb.append(", body="); + sb.append(this.environment == null ? "null" : this.environment); + if (this.created != null) { + sb.append(",creationTimestamp="); + sb.append(DateFormat.getInstance().format(this.created)); + } + return sb.toString(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatFiles.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatFiles.java index 6fe1e08f0d..3badf2ae11 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatFiles.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatFiles.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -31,127 +30,125 @@ 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 com.openpojo.business.annotation.BusinessKey; @Entity @Table(name = "heat_files") public class HeatFiles implements Serializable { - private static final long serialVersionUID = 768026109321305392L; + private static final long serialVersionUID = 768026109321305392L; - @BusinessKey - @Id - @Column(name = "ARTIFACT_UUID") - private String artifactUuid; - - @Column(name = "DESCRIPTION") - private String description = null; + @BusinessKey + @Id + @Column(name = "ARTIFACT_UUID") + private String artifactUuid; + + @Column(name = "DESCRIPTION") + private String description = null; - @Column(name = "NAME") - private String fileName; - - @Lob - @Column(name = "BODY", columnDefinition = "LONGTEXT") - private String fileBody; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @Column(name = "ARTIFACT_CHECKSUM") - private String artifactChecksum; - - @Column(name = "VERSION") - private String version; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("description", description) - .append("fileName", fileName).append("fileBody", fileBody).append("created", created) - .append("artifactChecksum", artifactChecksum).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof HeatFiles)) { - return false; - } - HeatFiles castOther = (HeatFiles) other; - return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(artifactUuid).toHashCode(); - } - - public String getArtifactUuid() { - return this.artifactUuid; - } - - public void setArtifactUuid(String artifactUuid) { - this.artifactUuid = artifactUuid; - } - - public String getDescription() { - return this.description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getFileName() { - return this.fileName; - } - - public void setFileName(String fileName) { - this.fileName = fileName; - } - - public String getFileBody() { - return this.fileBody; - } - - public void setFileBody(String fileBody) { - this.fileBody = fileBody; - } - - public Date getCreated() { - return created; - } - - public String getAsdcUuid() { - return this.artifactUuid; - } - - public void setAsdcUuid(String artifactUuid) { - this.artifactUuid = artifactUuid; - } - - public String getArtifactChecksum() { - return artifactChecksum; - } - - public void setArtifactChecksum(String artifactChecksum) { - this.artifactChecksum = artifactChecksum; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } + @Column(name = "NAME") + private String fileName; + + @Lob + @Column(name = "BODY", columnDefinition = "LONGTEXT") + private String fileBody; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @Column(name = "ARTIFACT_CHECKSUM") + private String artifactChecksum; + + @Column(name = "VERSION") + private String version; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("description", description) + .append("fileName", fileName).append("fileBody", fileBody).append("created", created) + .append("artifactChecksum", artifactChecksum).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof HeatFiles)) { + return false; + } + HeatFiles castOther = (HeatFiles) other; + return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(artifactUuid).toHashCode(); + } + + public String getArtifactUuid() { + return this.artifactUuid; + } + + public void setArtifactUuid(String artifactUuid) { + this.artifactUuid = artifactUuid; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getFileName() { + return this.fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public String getFileBody() { + return this.fileBody; + } + + public void setFileBody(String fileBody) { + this.fileBody = fileBody; + } + + public Date getCreated() { + return created; + } + + public String getAsdcUuid() { + return this.artifactUuid; + } + + public void setAsdcUuid(String artifactUuid) { + this.artifactUuid = artifactUuid; + } + + public String getArtifactChecksum() { + return artifactChecksum; + } + + public void setArtifactChecksum(String artifactChecksum) { + this.artifactChecksum = artifactChecksum; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplate.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplate.java index 2389793f33..82725f089d 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplate.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplate.java @@ -26,7 +26,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,173 +38,171 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "heat_template") public class HeatTemplate implements Serializable { - private static final long serialVersionUID = 768026109321305392L; - - @BusinessKey - @Id - @Column(name = "ARTIFACT_UUID", length = 200) - private String artifactUuid; - - @Column(name = "NAME", length = 200) - private String templateName; - - @Lob - @Column(name = "BODY", columnDefinition = "LONGTEXT") - private String templateBody = null; - - @Column(name = "TIMEOUT_MINUTES", length = 20) - private Integer timeoutMinutes; - - @BusinessKey - @Column(name = "VERSION") - private String version; - - @Column(name = "DESCRIPTION", length = 1200) - private String description; - - @Column(name = "ARTIFACT_CHECKSUM", length = 200) - private String artifactChecksum; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "heatTemplateArtifactUuid") - private Set<HeatTemplateParam> parameters; - - @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "heat_nested_template", joinColumns = @JoinColumn(name = "PARENT_HEAT_TEMPLATE_UUID"), inverseJoinColumns = @JoinColumn(name = "CHILD_HEAT_TEMPLATE_UUID")) - private List<HeatTemplate> childTemplates; - - public enum TemplateStatus { - PARENT, CHILD, PARENT_COMPLETE - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("templateName", templateName) - .append("templateBody", templateBody).append("timeoutMinutes", timeoutMinutes) - .append("version", version).append("description", description) - .append("artifactChecksum", artifactChecksum).append("created", created) - .append("parameters", parameters).append("childTemplates", childTemplates).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof HeatTemplate)) { - return false; - } - HeatTemplate castOther = (HeatTemplate) other; - return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).append(version, castOther.version) - .isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(artifactUuid).append(version).toHashCode(); - } - - @LinkedResource - public List<HeatTemplate> getChildTemplates() { - if (childTemplates == null) - childTemplates = new ArrayList<>(); - return childTemplates; - } - - public void setChildTemplates(List<HeatTemplate> childTemplates) { - this.childTemplates = childTemplates; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getArtifactUuid() { - return this.artifactUuid; - } - - public void setArtifactUuid(String artifactUuid) { - this.artifactUuid = artifactUuid; - } - - public String getTemplateName() { - return templateName; - } - - public void setTemplateName(String templateName) { - this.templateName = templateName; - } - - public String getTemplateBody() { - return templateBody; - } - - public void setTemplateBody(String templateBody) { - this.templateBody = templateBody; - } - - public Integer getTimeoutMinutes() { - return timeoutMinutes; - } - - public void setTimeoutMinutes(Integer timeout) { - this.timeoutMinutes = timeout; - } - - @LinkedResource - public Set<HeatTemplateParam> getParameters() { - if (parameters == null) - parameters = new HashSet<>(); - return parameters; - } - - public void setParameters(Set<HeatTemplateParam> parameters) { - this.parameters = parameters; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getHeatTemplate() { - return this.templateBody; - } - - public String getArtifactChecksum() { - return artifactChecksum; - } - - public void setArtifactChecksum(String artifactChecksum) { - this.artifactChecksum = artifactChecksum; - } - - public Date getCreated() { - return created; - } + private static final long serialVersionUID = 768026109321305392L; + + @BusinessKey + @Id + @Column(name = "ARTIFACT_UUID", length = 200) + private String artifactUuid; + + @Column(name = "NAME", length = 200) + private String templateName; + + @Lob + @Column(name = "BODY", columnDefinition = "LONGTEXT") + private String templateBody = null; + + @Column(name = "TIMEOUT_MINUTES", length = 20) + private Integer timeoutMinutes; + + @BusinessKey + @Column(name = "VERSION") + private String version; + + @Column(name = "DESCRIPTION", length = 1200) + private String description; + + @Column(name = "ARTIFACT_CHECKSUM", length = 200) + private String artifactChecksum; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "heatTemplateArtifactUuid") + private Set<HeatTemplateParam> parameters; + + @OneToMany(cascade = CascadeType.ALL) + @JoinTable(name = "heat_nested_template", joinColumns = @JoinColumn(name = "PARENT_HEAT_TEMPLATE_UUID"), + inverseJoinColumns = @JoinColumn(name = "CHILD_HEAT_TEMPLATE_UUID")) + private List<HeatTemplate> childTemplates; + + public enum TemplateStatus { + PARENT, CHILD, PARENT_COMPLETE + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("artifactUuid", artifactUuid).append("templateName", templateName) + .append("templateBody", templateBody).append("timeoutMinutes", timeoutMinutes) + .append("version", version).append("description", description) + .append("artifactChecksum", artifactChecksum).append("created", created) + .append("parameters", parameters).append("childTemplates", childTemplates).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof HeatTemplate)) { + return false; + } + HeatTemplate castOther = (HeatTemplate) other; + return new EqualsBuilder().append(artifactUuid, castOther.artifactUuid).append(version, castOther.version) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(artifactUuid).append(version).toHashCode(); + } + + @LinkedResource + public List<HeatTemplate> getChildTemplates() { + if (childTemplates == null) + childTemplates = new ArrayList<>(); + return childTemplates; + } + + public void setChildTemplates(List<HeatTemplate> childTemplates) { + this.childTemplates = childTemplates; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getArtifactUuid() { + return this.artifactUuid; + } + + public void setArtifactUuid(String artifactUuid) { + this.artifactUuid = artifactUuid; + } + + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + public String getTemplateBody() { + return templateBody; + } + + public void setTemplateBody(String templateBody) { + this.templateBody = templateBody; + } + + public Integer getTimeoutMinutes() { + return timeoutMinutes; + } + + public void setTimeoutMinutes(Integer timeout) { + this.timeoutMinutes = timeout; + } + + @LinkedResource + public Set<HeatTemplateParam> getParameters() { + if (parameters == null) + parameters = new HashSet<>(); + return parameters; + } + + public void setParameters(Set<HeatTemplateParam> parameters) { + this.parameters = parameters; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getHeatTemplate() { + return this.templateBody; + } + + public String getArtifactChecksum() { + return artifactChecksum; + } + + public void setArtifactChecksum(String artifactChecksum) { + this.artifactChecksum = artifactChecksum; + } + + public Date getCreated() { + return created; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParam.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParam.java index cdbe7aee7a..6abf695797 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParam.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParam.java @@ -21,17 +21,14 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; 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; @IdClass(HeatTemplateParamId.class) @@ -39,86 +36,86 @@ import com.openpojo.business.annotation.BusinessKey; @Table(name = "heat_template_params") public class HeatTemplateParam implements Serializable { - @BusinessKey - @Id - @Column(name = "HEAT_TEMPLATE_ARTIFACT_UUID") - private String heatTemplateArtifactUuid; - - @BusinessKey - @Id - @Column(name = "PARAM_NAME") - private String paramName; - - @Column(name = "IS_REQUIRED") - private Boolean required; - - @Column(name = "PARAM_TYPE") - private String paramType; - - @Column(name = "PARAM_ALIAS") - private String paramAlias; - - public static final long serialVersionUID = -1322322139926390329L; - - @Override - public String toString() { - return new ToStringBuilder(this).append("heatTemplateArtifactUuid", heatTemplateArtifactUuid) - .append("paramName", paramName).append("required", required).append("paramType", paramType) - .append("paramAlias", paramAlias).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof HeatTemplateParam)) { - return false; - } - HeatTemplateParam castOther = (HeatTemplateParam) other; - return new EqualsBuilder().append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid) - .append(paramName, castOther.paramName).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(heatTemplateArtifactUuid).append(paramName).toHashCode(); - } - - public String getHeatTemplateArtifactUuid() { - return this.heatTemplateArtifactUuid; - } - - public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { - this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; - } - - public String getParamName() { - return paramName; - } - - public void setParamName(String paramName) { - this.paramName = paramName; - } - - public Boolean isRequired() { - return required; - } - - public void setRequired(Boolean required) { - this.required = required; - } - - public String getParamAlias() { - return paramAlias; - } - - public void setParamAlias(String paramAlias) { - this.paramAlias = paramAlias; - } - - public String getParamType() { - return paramType; - } - - public void setParamType(String paramType) { - this.paramType = paramType; - } + @BusinessKey + @Id + @Column(name = "HEAT_TEMPLATE_ARTIFACT_UUID") + private String heatTemplateArtifactUuid; + + @BusinessKey + @Id + @Column(name = "PARAM_NAME") + private String paramName; + + @Column(name = "IS_REQUIRED") + private Boolean required; + + @Column(name = "PARAM_TYPE") + private String paramType; + + @Column(name = "PARAM_ALIAS") + private String paramAlias; + + public static final long serialVersionUID = -1322322139926390329L; + + @Override + public String toString() { + return new ToStringBuilder(this).append("heatTemplateArtifactUuid", heatTemplateArtifactUuid) + .append("paramName", paramName).append("required", required).append("paramType", paramType) + .append("paramAlias", paramAlias).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof HeatTemplateParam)) { + return false; + } + HeatTemplateParam castOther = (HeatTemplateParam) other; + return new EqualsBuilder().append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid) + .append(paramName, castOther.paramName).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(heatTemplateArtifactUuid).append(paramName).toHashCode(); + } + + public String getHeatTemplateArtifactUuid() { + return this.heatTemplateArtifactUuid; + } + + public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { + this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; + } + + public String getParamName() { + return paramName; + } + + public void setParamName(String paramName) { + this.paramName = paramName; + } + + public Boolean isRequired() { + return required; + } + + public void setRequired(Boolean required) { + this.required = required; + } + + public String getParamAlias() { + return paramAlias; + } + + public void setParamAlias(String paramAlias) { + this.paramAlias = paramAlias; + } + + public String getParamType() { + return paramType; + } + + public void setParamType(String paramType) { + this.paramType = paramType; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParamId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParamId.java index 61c199c43f..6e494bf95f 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParamId.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HeatTemplateParamId.java @@ -21,55 +21,53 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - 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; public class HeatTemplateParamId implements Serializable { - @BusinessKey - private String heatTemplateArtifactUuid; - @BusinessKey - private String paramName; + @BusinessKey + private String heatTemplateArtifactUuid; + @BusinessKey + private String paramName; - public static final long serialVersionUID = -1322322139926390329L; + public static final long serialVersionUID = -1322322139926390329L; - @Override - public boolean equals(final Object other) { - if (!(other instanceof HeatTemplateParamId)) { - return false; - } - HeatTemplateParamId castOther = (HeatTemplateParamId) other; - return new EqualsBuilder().append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid) - .append(paramName, castOther.paramName).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof HeatTemplateParamId)) { + return false; + } + HeatTemplateParamId castOther = (HeatTemplateParamId) other; + return new EqualsBuilder().append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid) + .append(paramName, castOther.paramName).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(heatTemplateArtifactUuid).append(paramName).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(heatTemplateArtifactUuid).append(paramName).toHashCode(); + } - public String getHeatTemplateArtifactUuid() { - return this.heatTemplateArtifactUuid; - } + public String getHeatTemplateArtifactUuid() { + return this.heatTemplateArtifactUuid; + } - public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { - this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; - } + public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { + this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; + } - public String getParamName() { - return this.paramName; - } + public String getParamName() { + return this.paramName; + } - public void setParamName(String paramName) { - this.paramName = paramName; - } + public void setParamName(String paramName) { + this.paramName = paramName; + } - @Override - public String toString() { - return new ToStringBuilder(this).append("heatTemplateArtifactUuid", heatTemplateArtifactUuid) - .append("paramName", paramName).toString(); - } + @Override + public String toString() { + return new ToStringBuilder(this).append("heatTemplateArtifactUuid", heatTemplateArtifactUuid) + .append("paramName", paramName).toString(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HomingInstance.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HomingInstance.java index ef474be159..75871afe83 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HomingInstance.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/HomingInstance.java @@ -26,7 +26,6 @@ import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; import uk.co.blackpepper.bowman.annotation.RemoteResource; import uk.co.blackpepper.bowman.annotation.ResourceId; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -35,8 +34,8 @@ import javax.persistence.Transient; import java.net.URI; /** - * EntityBean class for a HomingInstance. This bean represents a homing instance - * of a service, populated on successful homing + * EntityBean class for a HomingInstance. This bean represents a homing instance of a service, populated on successful + * homing * */ @RemoteResource("/homingInstance") @@ -69,11 +68,11 @@ public class HomingInstance { @Transient private URI uri; - public HomingInstance () { + public HomingInstance() { } - public HomingInstance (HomingInstance homingInstance) { + public HomingInstance(HomingInstance homingInstance) { this.serviceInstanceId = homingInstance.getServiceInstanceId(); this.cloudRegionId = homingInstance.getCloudRegionId(); this.cloudOwner = homingInstance.getCloudOwner(); @@ -105,7 +104,7 @@ public class HomingInstance { return this.cloudOwner; } - public void setCloudOwner (String cloudOwner) { + public void setCloudOwner(String cloudOwner) { this.cloudOwner = cloudOwner; } @@ -131,8 +130,7 @@ public class HomingInstance { @Override public String toString() { return new ToStringBuilder(this).append("serviceInstanceId", serviceInstanceId) - .append("cloudRegionId", cloudRegionId) - .append("cloudOwner", cloudOwner) + .append("cloudRegionId", cloudRegionId).append("cloudOwner", cloudOwner) .append("oofDirectives", oofDirectives).toString(); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroup.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroup.java index 43d4acffcc..d226ffee13 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroup.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroup.java @@ -24,7 +24,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.DiscriminatorColumn; @@ -42,13 +41,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @@ -57,177 +53,177 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "instance_group") public class InstanceGroup implements Serializable { - /** - * - */ - private static final long serialVersionUID = -263859017727376578L; - - @BusinessKey - @Id - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "ROLE") - private String role; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Enumerated(EnumType.STRING) - @Column(name = "INSTANCE_GROUP_TYPE") - private InstanceGroupType type; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "CR_MODEL_UUID") - private CollectionResource collectionResource; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "instanceGroup") - private List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "instanceGroup") - private List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations = new ArrayList<>(); - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "instanceGroup") - private List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomizations; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelName", modelName) - .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) - .append("role", role).append("toscaNodeType", toscaNodeType).append("type", type) - .append("created", created).append("collectionResource", collectionResource) - .append("collectionInstanceGroupCustomizations", collectionInstanceGroupCustomizations) - .append("vnfcInstanceGroupCustomizations", vnfcInstanceGroupCustomizations).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof InstanceGroup)) { - return false; - } - InstanceGroup castOther = (InstanceGroup) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelUUID() { - return modelUUID; - } - - public Date getCreated() { - return created; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelName() { - return modelName; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getRole() { - return role; - } - - public void setRole(String role) { - this.role = role; - } - - public InstanceGroupType getType() { - return type; - } - - public void setType(InstanceGroupType type) { - this.type = type; - } - - @LinkedResource - public CollectionResource getCollectionResource() { - return collectionResource; - } - - public void setCollectionResource(CollectionResource collectionResource) { - this.collectionResource = collectionResource; - } - - @LinkedResource - public List<CollectionResourceInstanceGroupCustomization> getCollectionInstanceGroupCustomizations() { - return collectionInstanceGroupCustomizations; - } - - public void setCollectionInstanceGroupCustomizations( - List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations) { - this.collectionInstanceGroupCustomizations = collectionInstanceGroupCustomizations; - } - - @LinkedResource - public List<VnfcInstanceGroupCustomization> getVnfcInstanceGroupCustomizations() { - return vnfcInstanceGroupCustomizations; - } - - public void setVnfcInstanceGroupCustomizations( - List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations) { - this.vnfcInstanceGroupCustomizations = vnfcInstanceGroupCustomizations; - } - - @LinkedResource - public List<CollectionNetworkResourceCustomization> getCollectionNetworkResourceCustomizations() { - return collectionNetworkResourceCustomizations; - } - - public void setCollectionNetworkResourceCustomizations( - List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomizations) { - this.collectionNetworkResourceCustomizations = collectionNetworkResourceCustomizations; - } -}
\ No newline at end of file + /** + * + */ + private static final long serialVersionUID = -263859017727376578L; + + @BusinessKey + @Id + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "ROLE") + private String role; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; + + @Enumerated(EnumType.STRING) + @Column(name = "INSTANCE_GROUP_TYPE") + private InstanceGroupType type; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "CR_MODEL_UUID") + private CollectionResource collectionResource; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "instanceGroup") + private List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "instanceGroup") + private List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations = new ArrayList<>(); + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "instanceGroup") + private List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomizations; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelName", modelName) + .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) + .append("role", role).append("toscaNodeType", toscaNodeType).append("type", type) + .append("created", created).append("collectionResource", collectionResource) + .append("collectionInstanceGroupCustomizations", collectionInstanceGroupCustomizations) + .append("vnfcInstanceGroupCustomizations", vnfcInstanceGroupCustomizations).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof InstanceGroup)) { + return false; + } + InstanceGroup castOther = (InstanceGroup) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelUUID() { + return modelUUID; + } + + public Date getCreated() { + return created; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelName() { + return modelName; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getRole() { + return role; + } + + public void setRole(String role) { + this.role = role; + } + + public InstanceGroupType getType() { + return type; + } + + public void setType(InstanceGroupType type) { + this.type = type; + } + + @LinkedResource + public CollectionResource getCollectionResource() { + return collectionResource; + } + + public void setCollectionResource(CollectionResource collectionResource) { + this.collectionResource = collectionResource; + } + + @LinkedResource + public List<CollectionResourceInstanceGroupCustomization> getCollectionInstanceGroupCustomizations() { + return collectionInstanceGroupCustomizations; + } + + public void setCollectionInstanceGroupCustomizations( + List<CollectionResourceInstanceGroupCustomization> collectionInstanceGroupCustomizations) { + this.collectionInstanceGroupCustomizations = collectionInstanceGroupCustomizations; + } + + @LinkedResource + public List<VnfcInstanceGroupCustomization> getVnfcInstanceGroupCustomizations() { + return vnfcInstanceGroupCustomizations; + } + + public void setVnfcInstanceGroupCustomizations( + List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations) { + this.vnfcInstanceGroupCustomizations = vnfcInstanceGroupCustomizations; + } + + @LinkedResource + public List<CollectionNetworkResourceCustomization> getCollectionNetworkResourceCustomizations() { + return collectionNetworkResourceCustomizations; + } + + public void setCollectionNetworkResourceCustomizations( + List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomizations) { + this.collectionNetworkResourceCustomizations = collectionNetworkResourceCustomizations; + } +} diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroupType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroupType.java index e67078b104..764d3c4a53 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroupType.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/InstanceGroupType.java @@ -21,5 +21,5 @@ package org.onap.so.db.catalog.beans; public enum InstanceGroupType { - L3_NETWORK, VNFC; + L3_NETWORK, VNFC; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Model.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Model.java index 9c5c23ef0e..0592e8f058 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Model.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Model.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.Map; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -36,194 +35,193 @@ import javax.persistence.OneToMany; 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 com.openpojo.business.annotation.BusinessKey; + @Entity @Table(name = "model") public class Model implements Serializable { - - private static final long serialVersionUID = 768026109321305392L; - - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - @Column(name = "MODEL_CUSTOMIZATION_ID", length = 40) - private String modelCustomizationId = null; - @Column(name = "MODEL_CUSTOMIZATION_NAME", length = 40) - private String modelCustomizationName = null; - @Column(name = "MODEL_INVARIANT_ID", length = 40) - private String modelInvariantId = null; - @Column(name = "MODEL_NAME", length = 40) - private String modelName = null; - @BusinessKey - @Column(name = "MODEL_TYPE", length = 20) - private String modelType = null; - @Column(name = "MODEL_VERSION", length = 20) - private String modelVersion = null; - @BusinessKey - @Column(name = "MODEL_VERSION_ID", length = 40) - private String modelVersionId = null; - @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created = null; - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy="modelId") - @MapKey(name = "action") - private Map<String,ModelRecipe> recipes; - - /** - * @return the id - */ - public Integer getId() { - return id; - } - - /** - * @return the modelCustomizationId - */ - public String getModelCustomizationId() { - return modelCustomizationId; - } - - /** - * @param modelCustomizationId the modelCustomizationId to set - */ - public void setModelCustomizationId(String modelCustomizationId) { - this.modelCustomizationId = modelCustomizationId; - } - - /** - * @return the modelCustomizationName - */ - public String getModelCustomizationName() { - return modelCustomizationName; - } - - /** - * @param modelCustomizationName the modelCustomizationName to set - */ - public void setModelCustomizationName(String modelCustomizationName) { - this.modelCustomizationName = modelCustomizationName; - } - - /** - * @return the modelInvariantId - */ - public String getModelInvariantId() { - return modelInvariantId; - } - - /** - * @param modelInvariantId the modelInvariantId to set - */ - public void setModelInvariantId(String modelInvariantId) { - this.modelInvariantId = modelInvariantId; - } - - /** - * @return the modelName - */ - public String getModelName() { - return modelName; - } - - /** - * @param modelName the modelName to set - */ - public void setModelName(String modelName) { - this.modelName = modelName; - } - - /** - * @return the modelType - */ - public String getModelType() { - return modelType; - } - - /** - * @param modelType the modelType to set - */ - public void setModelType(String modelType) { - this.modelType = modelType; - } - - /** - * @return the modelVersion - */ - public String getModelVersion() { - return modelVersion; - } - - /** - * @param modelVersion the modelVersion to set - */ - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - /** - * @return the modelVersionId - */ - public String getModelVersionId() { - return modelVersionId; - } - - /** - * @param modelVersionId the modelVersionId to set - */ - public void setModelVersionId(String modelVersionId) { - this.modelVersionId = modelVersionId; - } - - /** - * @return the created - */ - public Date getCreated() { - return created; - } - - /** - * @return the recipes - */ - public Map<String, ModelRecipe> getRecipes() { - return recipes; - } - - /** - * @param recipes the recipes to set - */ - public void setRecipes(Map<String, ModelRecipe> recipes) { - this.recipes = recipes; - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof Model)) { - return false; - } - Model castOther = (Model) other; - return new EqualsBuilder().append(getModelType(), castOther.getModelType()) - .append(getModelVersionId(), castOther.getModelVersionId()).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(getModelType()).append(getModelVersionId()).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", getId()).append("modelCustomizationId", getModelCustomizationId()) - .append("modelCustomizationName", getModelCustomizationName()) - .append("modelInvariantId", getModelInvariantId()).append("modelName", getModelName()) - .append("modelType", getModelType()).append("modelVersion", getModelVersion()) - .append("modelVersionId", getModelVersionId()).append("created", getCreated()) - .append("recipes", getRecipes()).toString(); - } + + private static final long serialVersionUID = 768026109321305392L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + @Column(name = "MODEL_CUSTOMIZATION_ID", length = 40) + private String modelCustomizationId = null; + @Column(name = "MODEL_CUSTOMIZATION_NAME", length = 40) + private String modelCustomizationName = null; + @Column(name = "MODEL_INVARIANT_ID", length = 40) + private String modelInvariantId = null; + @Column(name = "MODEL_NAME", length = 40) + private String modelName = null; + @BusinessKey + @Column(name = "MODEL_TYPE", length = 20) + private String modelType = null; + @Column(name = "MODEL_VERSION", length = 20) + private String modelVersion = null; + @BusinessKey + @Column(name = "MODEL_VERSION_ID", length = 40) + private String modelVersionId = null; + @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created = null; + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "modelId") + @MapKey(name = "action") + private Map<String, ModelRecipe> recipes; + + /** + * @return the id + */ + public Integer getId() { + return id; + } + + /** + * @return the modelCustomizationId + */ + public String getModelCustomizationId() { + return modelCustomizationId; + } + + /** + * @param modelCustomizationId the modelCustomizationId to set + */ + public void setModelCustomizationId(String modelCustomizationId) { + this.modelCustomizationId = modelCustomizationId; + } + + /** + * @return the modelCustomizationName + */ + public String getModelCustomizationName() { + return modelCustomizationName; + } + + /** + * @param modelCustomizationName the modelCustomizationName to set + */ + public void setModelCustomizationName(String modelCustomizationName) { + this.modelCustomizationName = modelCustomizationName; + } + + /** + * @return the modelInvariantId + */ + public String getModelInvariantId() { + return modelInvariantId; + } + + /** + * @param modelInvariantId the modelInvariantId to set + */ + public void setModelInvariantId(String modelInvariantId) { + this.modelInvariantId = modelInvariantId; + } + + /** + * @return the modelName + */ + public String getModelName() { + return modelName; + } + + /** + * @param modelName the modelName to set + */ + public void setModelName(String modelName) { + this.modelName = modelName; + } + + /** + * @return the modelType + */ + public String getModelType() { + return modelType; + } + + /** + * @param modelType the modelType to set + */ + public void setModelType(String modelType) { + this.modelType = modelType; + } + + /** + * @return the modelVersion + */ + public String getModelVersion() { + return modelVersion; + } + + /** + * @param modelVersion the modelVersion to set + */ + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + /** + * @return the modelVersionId + */ + public String getModelVersionId() { + return modelVersionId; + } + + /** + * @param modelVersionId the modelVersionId to set + */ + public void setModelVersionId(String modelVersionId) { + this.modelVersionId = modelVersionId; + } + + /** + * @return the created + */ + public Date getCreated() { + return created; + } + + /** + * @return the recipes + */ + public Map<String, ModelRecipe> getRecipes() { + return recipes; + } + + /** + * @param recipes the recipes to set + */ + public void setRecipes(Map<String, ModelRecipe> recipes) { + this.recipes = recipes; + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof Model)) { + return false; + } + Model castOther = (Model) other; + return new EqualsBuilder().append(getModelType(), castOther.getModelType()) + .append(getModelVersionId(), castOther.getModelVersionId()).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(getModelType()).append(getModelVersionId()).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", getId()).append("modelCustomizationId", getModelCustomizationId()) + .append("modelCustomizationName", getModelCustomizationName()) + .append("modelInvariantId", getModelInvariantId()).append("modelName", getModelName()) + .append("modelType", getModelType()).append("modelVersion", getModelVersion()) + .append("modelVersionId", getModelVersionId()).append("created", getCreated()) + .append("recipes", getRecipes()).toString(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ModelRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ModelRecipe.java index 3d7cb68172..3f89e9db74 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ModelRecipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ModelRecipe.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -31,176 +30,174 @@ import javax.persistence.Id; 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 com.openpojo.business.annotation.BusinessKey; @Entity @Table(name = "model_recipe") public class ModelRecipe implements Serializable { - - private static final long serialVersionUID = 768026109321305392L; - - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - @BusinessKey - @Column(name = "MODEL_ID", nullable = false) - private Integer modelId; - @BusinessKey - @Column(name = "ACTION", length = 50) - private String action = null; - @Column(name = "SCHEMA_VERSION", length = 20) - private String schemaVersion = null; - @Column(name = "DESCRIPTION", length = 1200) - private String description = null; - @Column(name = "ORCHESTRATION_URI", length = 256) - private String orchestrationUri = null; - @Column(name = "MODEL_PARAM_XSD", length = 2048) - private String modelParamXSD = null; - @Column(name = "RECIPE_TIMEOUT") - private Integer recipeTimeout; - @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created = null; - - /** - * @return the id - */ - public Integer getId() { - return id; - } - - /** - * @return the modelId - */ - public Integer getModelId() { - return modelId; - } - - /** - * @param modelId the modelId to set - */ - public void setModelId(Integer modelId) { - this.modelId = modelId; - } - - /** - * @return the action - */ - public String getAction() { - return action; - } - - /** - * @param action the action to set - */ - public void setAction(String action) { - this.action = action; - } - - /** - * @return the versionStr - */ - public String getSchemaVersion() { - return schemaVersion; - } - - /** - * @param schemaVersion the versionStr to set - */ - public void setSchemaVersion(String schemaVersion) { - this.schemaVersion = schemaVersion; - } - - /** - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * @param description the description to set - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * @return the orchestrationUri - */ - public String getOrchestrationUri() { - return orchestrationUri; - } - - /** - * @param orchestrationUri the orchestrationUri to set - */ - public void setOrchestrationUri(String orchestrationUri) { - this.orchestrationUri = orchestrationUri; - } - - /** - * @return the modelParamXSD - */ - public String getModelParamXSD() { - return modelParamXSD; - } - - /** - * @param modelParamXSD the modelParamXSD to set - */ - public void setModelParamXSD(String modelParamXSD) { - this.modelParamXSD = modelParamXSD; - } - - /** - * @return the recipeTimeout - */ - public Integer getRecipeTimeout() { - return recipeTimeout; - } - - /** - * @param recipeTimeout the recipeTimeout to set - */ - public void setRecipeTimeout(Integer recipeTimeout) { - this.recipeTimeout = recipeTimeout; - } - - /** - * @return the created - */ - public Date getCreated() { - return created; - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ModelRecipe)) { - return false; - } - ModelRecipe castOther = (ModelRecipe) other; - return new EqualsBuilder().append(getModelId(), castOther.getModelId()) - .append(getAction(), castOther.getAction()).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(getModelId()).append(getAction()).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", getId()).append("modelId", getModelId()) - .append("action", getAction()).append("schemaVersion", getSchemaVersion()) - .append("description", getDescription()).append("orchestrationUri", getOrchestrationUri()) - .append("modelParamXSD", getModelParamXSD()).append("recipeTimeout", getRecipeTimeout()) - .append("created", getCreated()).toString(); - } + + private static final long serialVersionUID = 768026109321305392L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + @BusinessKey + @Column(name = "MODEL_ID", nullable = false) + private Integer modelId; + @BusinessKey + @Column(name = "ACTION", length = 50) + private String action = null; + @Column(name = "SCHEMA_VERSION", length = 20) + private String schemaVersion = null; + @Column(name = "DESCRIPTION", length = 1200) + private String description = null; + @Column(name = "ORCHESTRATION_URI", length = 256) + private String orchestrationUri = null; + @Column(name = "MODEL_PARAM_XSD", length = 2048) + private String modelParamXSD = null; + @Column(name = "RECIPE_TIMEOUT") + private Integer recipeTimeout; + @Column(name = "CREATION_TIMESTAMP", nullable = false, updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created = null; + + /** + * @return the id + */ + public Integer getId() { + return id; + } + + /** + * @return the modelId + */ + public Integer getModelId() { + return modelId; + } + + /** + * @param modelId the modelId to set + */ + public void setModelId(Integer modelId) { + this.modelId = modelId; + } + + /** + * @return the action + */ + public String getAction() { + return action; + } + + /** + * @param action the action to set + */ + public void setAction(String action) { + this.action = action; + } + + /** + * @return the versionStr + */ + public String getSchemaVersion() { + return schemaVersion; + } + + /** + * @param schemaVersion the versionStr to set + */ + public void setSchemaVersion(String schemaVersion) { + this.schemaVersion = schemaVersion; + } + + /** + * @return the description + */ + public String getDescription() { + return description; + } + + /** + * @param description the description to set + */ + public void setDescription(String description) { + this.description = description; + } + + /** + * @return the orchestrationUri + */ + public String getOrchestrationUri() { + return orchestrationUri; + } + + /** + * @param orchestrationUri the orchestrationUri to set + */ + public void setOrchestrationUri(String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + /** + * @return the modelParamXSD + */ + public String getModelParamXSD() { + return modelParamXSD; + } + + /** + * @param modelParamXSD the modelParamXSD to set + */ + public void setModelParamXSD(String modelParamXSD) { + this.modelParamXSD = modelParamXSD; + } + + /** + * @return the recipeTimeout + */ + public Integer getRecipeTimeout() { + return recipeTimeout; + } + + /** + * @param recipeTimeout the recipeTimeout to set + */ + public void setRecipeTimeout(Integer recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + /** + * @return the created + */ + public Date getCreated() { + return created; + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ModelRecipe)) { + return false; + } + ModelRecipe castOther = (ModelRecipe) other; + return new EqualsBuilder().append(getModelId(), castOther.getModelId()) + .append(getAction(), castOther.getAction()).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(getModelId()).append(getAction()).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", getId()).append("modelId", getModelId()) + .append("action", getAction()).append("schemaVersion", getSchemaVersion()) + .append("description", getDescription()).append("orchestrationUri", getOrchestrationUri()) + .append("modelParamXSD", getModelParamXSD()).append("recipeTimeout", getRecipeTimeout()) + .append("created", getCreated()).toString(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkCollectionResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkCollectionResourceCustomization.java index a1b51f9a6b..bb9079be23 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkCollectionResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkCollectionResourceCustomization.java @@ -21,33 +21,31 @@ package org.onap.so.db.catalog.beans; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.OneToMany; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @DiscriminatorValue(value = "NetworkCollection") public class NetworkCollectionResourceCustomization extends CollectionResourceCustomization { - /** - * - */ - private static final long serialVersionUID = -4571173204548832466L; + /** + * + */ + private static final long serialVersionUID = -4571173204548832466L; - @OneToMany(cascade = CascadeType.ALL, mappedBy = "networkResourceCustomization") - private Set<CollectionNetworkResourceCustomization> networkResourceCustomization; + @OneToMany(cascade = CascadeType.ALL, mappedBy = "networkResourceCustomization") + private Set<CollectionNetworkResourceCustomization> networkResourceCustomization; - @LinkedResource - public Set<CollectionNetworkResourceCustomization> getNetworkResourceCustomization() { - return networkResourceCustomization; - } + @LinkedResource + public Set<CollectionNetworkResourceCustomization> getNetworkResourceCustomization() { + return networkResourceCustomization; + } - public void setNetworkResourceCustomization( - Set<CollectionNetworkResourceCustomization> networkResourceCustomization) { - this.networkResourceCustomization = networkResourceCustomization; - } + public void setNetworkResourceCustomization( + Set<CollectionNetworkResourceCustomization> networkResourceCustomization) { + this.networkResourceCustomization = networkResourceCustomization; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkInstanceGroup.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkInstanceGroup.java index edda4b8122..24782efcf0 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkInstanceGroup.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkInstanceGroup.java @@ -27,8 +27,8 @@ import javax.persistence.Entity; @DiscriminatorValue(value = "L3_NETWORK") public class NetworkInstanceGroup extends InstanceGroup { - /** - * - */ - private static final long serialVersionUID = 1934855643166769237L; + /** + * + */ + private static final long serialVersionUID = 1934855643166769237L; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkRecipe.java index 51bcd54ae1..7bdbe9cdba 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkRecipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkRecipe.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -30,156 +29,154 @@ 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 com.openpojo.business.annotation.BusinessKey; @Entity @Table(name = "network_recipe") public class NetworkRecipe implements Serializable, Recipe { - private static final long serialVersionUID = 768026109321305392L; - - @Id - @Column(name = "id") - private Integer id; - - @BusinessKey - @Column(name = "ACTION") - protected String action; - - @Column(name = "DESCRIPTION") - private String description; - - @BusinessKey - @Column(name = "ORCHESTRATION_URI") - protected String orchestrationUri; - - @Column(name = "RECIPE_TIMEOUT") - private Integer recipeTimeout; - - @Column(name = "VERSION_STR") - private String versionStr; + private static final long serialVersionUID = 768026109321305392L; + + @Id + @Column(name = "id") + private Integer id; + + @BusinessKey + @Column(name = "ACTION") + protected String action; + + @Column(name = "DESCRIPTION") + private String description; + + @BusinessKey + @Column(name = "ORCHESTRATION_URI") + protected String orchestrationUri; + + @Column(name = "RECIPE_TIMEOUT") + private Integer recipeTimeout; + + @Column(name = "VERSION_STR") + private String versionStr; - @BusinessKey - @Column(name = "SERVICE_TYPE") - private String serviceType; + @BusinessKey + @Column(name = "SERVICE_TYPE") + private String serviceType; - @BusinessKey - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "NETWORK_PARAM_XSD") - private String paramXsd; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof NetworkRecipe)) { - return false; - } - NetworkRecipe castOther = (NetworkRecipe) other; - return new EqualsBuilder().append(action, castOther.action).append(orchestrationUri, castOther.orchestrationUri) - .append(serviceType, castOther.serviceType).append(modelName, castOther.modelName).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(action).append(orchestrationUri).append(serviceType).append(modelName) - .toHashCode(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getOrchestrationUri() { - return orchestrationUri; - } - - public void setOrchestrationUri(String orchestrationUri) { - this.orchestrationUri = orchestrationUri; - } - - public Integer getRecipeTimeout() { - return recipeTimeout; - } - - public void setRecipeTimeout(Integer recipeTimeout) { - this.recipeTimeout = recipeTimeout; - } - - public String getServiceType() { - return serviceType; - } - - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - public Date getCreated() { - return created; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getParamXsd() { - return paramXsd; - } - - public void setParamXsd(String paramXsd) { - this.paramXsd = paramXsd; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append(super.toString()); - sb.append(",modelName=" + modelName); - sb.append(",networkParamXSD=" + paramXsd); - return sb.toString(); - } - - public String getVersionStr() { - return versionStr; - } - - public void setVersionStr(String versionStr) { - this.versionStr = versionStr; - } + @BusinessKey + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "NETWORK_PARAM_XSD") + private String paramXsd; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof NetworkRecipe)) { + return false; + } + NetworkRecipe castOther = (NetworkRecipe) other; + return new EqualsBuilder().append(action, castOther.action).append(orchestrationUri, castOther.orchestrationUri) + .append(serviceType, castOther.serviceType).append(modelName, castOther.modelName).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(action).append(orchestrationUri).append(serviceType).append(modelName) + .toHashCode(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getOrchestrationUri() { + return orchestrationUri; + } + + public void setOrchestrationUri(String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + public Integer getRecipeTimeout() { + return recipeTimeout; + } + + public void setRecipeTimeout(Integer recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public Date getCreated() { + return created; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getParamXsd() { + return paramXsd; + } + + public void setParamXsd(String paramXsd) { + this.paramXsd = paramXsd; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(super.toString()); + sb.append(",modelName=" + modelName); + sb.append(",networkParamXSD=" + paramXsd); + return sb.toString(); + } + + public String getVersionStr() { + return versionStr; + } + + public void setVersionStr(String versionStr) { + this.versionStr = versionStr; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResource.java index c31cd61ce0..6876200754 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResource.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResource.java @@ -25,7 +25,6 @@ import java.text.DateFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -38,268 +37,263 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "network_resource") public class NetworkResource implements Serializable { - private static final long serialVersionUID = 768026109321305392L; + private static final long serialVersionUID = 768026109321305392L; - @BusinessKey - @Id - @Column(name = "MODEL_UUID") - private String modelUUID; + @BusinessKey + @Id + @Column(name = "MODEL_UUID") + private String modelUUID; - @Column(name = "ORCHESTRATION_MODE") - private String orchestrationMode = null; + @Column(name = "ORCHESTRATION_MODE") + private String orchestrationMode = null; - @Column(name = "DESCRIPTION") - private String description = null; + @Column(name = "DESCRIPTION") + private String description = null; - @Column(name = "NEUTRON_NETWORK_TYPE") - private String neutronNetworkType = null; + @Column(name = "NEUTRON_NETWORK_TYPE") + private String neutronNetworkType = null; - @Column(name = "AIC_VERSION_MIN") - private String aicVersionMin = null; + @Column(name = "AIC_VERSION_MIN") + private String aicVersionMin = null; - @Column(name = "AIC_VERSION_MAX") - private String aicVersionMax = null; + @Column(name = "AIC_VERSION_MAX") + private String aicVersionMax = null; - @Column(name = "MODEL_NAME") - private String modelName; + @Column(name = "MODEL_NAME") + private String modelName; - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; - @Column(name = "MODEL_VERSION") - private String modelVersion; + @Column(name = "MODEL_VERSION") + private String modelVersion; - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; - @Column(name = "RESOURCE_CATEGORY") - private String category; + @Column(name = "RESOURCE_CATEGORY") + private String category; - @Column(name = "RESOURCE_SUB_CATEGORY") - private String subCategory; + @Column(name = "RESOURCE_SUB_CATEGORY") + private String subCategory; - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "networkResource") - private List<NetworkResourceCustomization> networkResourceCustomization; + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "networkResource") + private List<NetworkResourceCustomization> networkResourceCustomization; - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "networkResource") - private List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomization; + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "networkResource") + private List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomization; - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "HEAT_TEMPLATE_ARTIFACT_UUID") - private HeatTemplate heatTemplate; + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "HEAT_TEMPLATE_ARTIFACT_UUID") + private HeatTemplate heatTemplate; - @PrePersist - protected void onCreate() { - this.created = new Date(); - } + @PrePersist + protected void onCreate() { + this.created = new Date(); + } - @Override - public boolean equals(final Object other) { - if (!(other instanceof NetworkResource)) { - return false; - } - NetworkResource castOther = (NetworkResource) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof NetworkResource)) { + return false; + } + NetworkResource castOther = (NetworkResource) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } - @LinkedResource - public List<NetworkResourceCustomization> getNetworkResourceCustomization() { - return networkResourceCustomization; - } + @LinkedResource + public List<NetworkResourceCustomization> getNetworkResourceCustomization() { + return networkResourceCustomization; + } - public void addNetworkResourceCustomization(NetworkResourceCustomization networkResourceCustomization) { - if (this.networkResourceCustomization == null) - this.networkResourceCustomization = new ArrayList<>(); + public void addNetworkResourceCustomization(NetworkResourceCustomization networkResourceCustomization) { + if (this.networkResourceCustomization == null) + this.networkResourceCustomization = new ArrayList<>(); - this.networkResourceCustomization.add(networkResourceCustomization); - } + this.networkResourceCustomization.add(networkResourceCustomization); + } - public void setNetworkResourceCustomization(List<NetworkResourceCustomization> networkResourceCustomization) { - this.networkResourceCustomization = networkResourceCustomization; - } + public void setNetworkResourceCustomization(List<NetworkResourceCustomization> networkResourceCustomization) { + this.networkResourceCustomization = networkResourceCustomization; + } - @LinkedResource - public List<CollectionNetworkResourceCustomization> getCollectionNetworkResourceCustomization() { - return collectionNetworkResourceCustomization; - } + @LinkedResource + public List<CollectionNetworkResourceCustomization> getCollectionNetworkResourceCustomization() { + return collectionNetworkResourceCustomization; + } - public void setCollectionNetworkResourceCustomization( - List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomization) { - this.collectionNetworkResourceCustomization = collectionNetworkResourceCustomization; - } - - public String getOrchestrationMode() { - return orchestrationMode; - } - - public void setOrchestrationMode(String orchestrationMode) { - this.orchestrationMode = orchestrationMode; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getNeutronNetworkType() { - return neutronNetworkType; - } - - public void setNeutronNetworkType(String neutronNetworkType) { - this.neutronNetworkType = neutronNetworkType; - } - - public Date getCreated() { - return created; - } - - public String getAicVersionMin() { - return aicVersionMin; - } - - public void setAicVersionMin(String aicVersionMin) { - this.aicVersionMin = aicVersionMin; - } - - public String getAicVersionMax() { - return aicVersionMax; - } - - public void setAicVersionMax(String aicVersionMax) { - this.aicVersionMax = aicVersionMax; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - /** - * @return Returns the category. - */ - public String getCategory() { - return category; - } - - /** - * @param category - * The category to set. - */ - public void setCategory(String category) { - this.category = category; - } - - /** - * @return Returns the subCategory. - */ - public String getSubCategory() { - return subCategory; - } - - /** - * @param subCategory - * The subCategory to set. - */ - public void setSubCategory(String subCategory) { - this.subCategory = subCategory; - } - - @LinkedResource - public HeatTemplate getHeatTemplate() { - return heatTemplate; - } - - public void setHeatTemplate(HeatTemplate heatTemplate) { - this.heatTemplate = heatTemplate; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("NETWORK Resource:"); - sb.append("modelVersion="); - sb.append(modelVersion); - sb.append(",mode="); - sb.append(orchestrationMode); - sb.append(",neutronType="); - sb.append(neutronNetworkType); - sb.append(",aicVersionMin="); - sb.append(aicVersionMin); - sb.append(",aicVersionMax="); - sb.append(aicVersionMax); - sb.append(",modelName="); - sb.append(modelName); - sb.append(",modelInvariantUUID="); - sb.append(modelInvariantUUID); - sb.append(",toscaNodeType="); - sb.append(toscaNodeType); - sb.append(",modelUUID="); - sb.append(modelUUID); - - if (created != null) { - sb.append(",created="); - sb.append(DateFormat.getInstance().format(created)); - } - - return sb.toString(); - } + public void setCollectionNetworkResourceCustomization( + List<CollectionNetworkResourceCustomization> collectionNetworkResourceCustomization) { + this.collectionNetworkResourceCustomization = collectionNetworkResourceCustomization; + } + + public String getOrchestrationMode() { + return orchestrationMode; + } + + public void setOrchestrationMode(String orchestrationMode) { + this.orchestrationMode = orchestrationMode; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getNeutronNetworkType() { + return neutronNetworkType; + } + + public void setNeutronNetworkType(String neutronNetworkType) { + this.neutronNetworkType = neutronNetworkType; + } + + public Date getCreated() { + return created; + } + + public String getAicVersionMin() { + return aicVersionMin; + } + + public void setAicVersionMin(String aicVersionMin) { + this.aicVersionMin = aicVersionMin; + } + + public String getAicVersionMax() { + return aicVersionMax; + } + + public void setAicVersionMax(String aicVersionMax) { + this.aicVersionMax = aicVersionMax; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + /** + * @return Returns the category. + */ + public String getCategory() { + return category; + } + + /** + * @param category The category to set. + */ + public void setCategory(String category) { + this.category = category; + } + + /** + * @return Returns the subCategory. + */ + public String getSubCategory() { + return subCategory; + } + + /** + * @param subCategory The subCategory to set. + */ + public void setSubCategory(String subCategory) { + this.subCategory = subCategory; + } + + @LinkedResource + public HeatTemplate getHeatTemplate() { + return heatTemplate; + } + + public void setHeatTemplate(HeatTemplate heatTemplate) { + this.heatTemplate = heatTemplate; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("NETWORK Resource:"); + sb.append("modelVersion="); + sb.append(modelVersion); + sb.append(",mode="); + sb.append(orchestrationMode); + sb.append(",neutronType="); + sb.append(neutronNetworkType); + sb.append(",aicVersionMin="); + sb.append(aicVersionMin); + sb.append(",aicVersionMax="); + sb.append(aicVersionMax); + sb.append(",modelName="); + sb.append(modelName); + sb.append(",modelInvariantUUID="); + sb.append(modelInvariantUUID); + sb.append(",toscaNodeType="); + sb.append(toscaNodeType); + sb.append(",modelUUID="); + sb.append(modelUUID); + + if (created != null) { + sb.append(",created="); + sb.append(DateFormat.getInstance().format(created)); + } + + return sb.toString(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResourceCustomization.java index 1e3b6fc220..9287fbcf84 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/NetworkResourceCustomization.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,149 +33,146 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "network_resource_customization") public class NetworkResourceCustomization implements Serializable { - public static final long serialVersionUID = -1322322139926390329L; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("created", created) - .append("networkTechnology", networkTechnology).append("networkType", networkType) - .append("networkScope", networkScope).append("networkRole", networkRole) - .append("networkResource", networkResource).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof NetworkResourceCustomization)) { - return false; - } - NetworkResourceCustomization castOther = (NetworkResourceCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); - } - - public NetworkResourceCustomization() { - super(); - } - - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID = null; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @Column(name = "NETWORK_TECHNOLOGY") - private String networkTechnology; - - @Column(name = "NETWORK_TYPE") - private String networkType = null; - - @Column(name = "NETWORK_SCOPE") - private String networkScope; - - @Column(name = "NETWORK_ROLE") - private String networkRole; - - @Column(name = "RESOURCE_INPUT") - private String resourceInput; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID") - private NetworkResource networkResource = null; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelCustomizationUUID() { - return this.modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return this.modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - @LinkedResource - public NetworkResource getNetworkResource() { - return this.networkResource; - } - - public void setNetworkResource(NetworkResource networkResource) { - this.networkResource = networkResource; - } - - public String getNetworkType() { - return this.networkType; - } - - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - - public Date getCreated() { - return this.created; - } - - public String getNetworkTechnology() { - return this.networkTechnology; - } - - public void setNetworkTechnology(String networkTechnology) { - this.networkTechnology = networkTechnology; - } - - public String getNetworkScope() { - return this.networkScope; - } - - public void setNetworkScope(String networkScope) { - this.networkScope = networkScope; - } + public static final long serialVersionUID = -1322322139926390329L; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("created", created) + .append("networkTechnology", networkTechnology).append("networkType", networkType) + .append("networkScope", networkScope).append("networkRole", networkRole) + .append("networkResource", networkResource).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof NetworkResourceCustomization)) { + return false; + } + NetworkResourceCustomization castOther = (NetworkResourceCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); + } + + public NetworkResourceCustomization() { + super(); + } + + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID = null; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @Column(name = "NETWORK_TECHNOLOGY") + private String networkTechnology; + + @Column(name = "NETWORK_TYPE") + private String networkType = null; + + @Column(name = "NETWORK_SCOPE") + private String networkScope; + + @Column(name = "NETWORK_ROLE") + private String networkRole; + + @Column(name = "RESOURCE_INPUT") + private String resourceInput; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "NETWORK_RESOURCE_MODEL_UUID") + private NetworkResource networkResource = null; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelCustomizationUUID() { + return this.modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return this.modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + @LinkedResource + public NetworkResource getNetworkResource() { + return this.networkResource; + } + + public void setNetworkResource(NetworkResource networkResource) { + this.networkResource = networkResource; + } + + public String getNetworkType() { + return this.networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public Date getCreated() { + return this.created; + } + + public String getNetworkTechnology() { + return this.networkTechnology; + } + + public void setNetworkTechnology(String networkTechnology) { + this.networkTechnology = networkTechnology; + } + + public String getNetworkScope() { + return this.networkScope; + } + + public void setNetworkScope(String networkScope) { + this.networkScope = networkScope; + } - public void setNetworkRole(String networkRole) { - this.networkRole = networkRole; - } + public void setNetworkRole(String networkRole) { + this.networkRole = networkRole; + } - public String getNetworkRole() { - return this.networkRole; - } + public String getNetworkRole() { + return this.networkRole; + } - public String getResourceInput() { - return resourceInput; - } + public String getResourceInput() { + return resourceInput; + } - public void setResourceInput(String resourceInput) { - this.resourceInput = resourceInput; - } + public void setResourceInput(String resourceInput) { + this.resourceInput = resourceInput; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java index 1fd254f254..cf8644eedc 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationAction.java @@ -20,28 +20,20 @@ package org.onap.so.db.catalog.beans; -//TODO find this file a new location? +// TODO find this file a new location? public enum OrchestrationAction { - ASSIGN("Assign"), - UNASSIGN("Unassign"), - ACTIVATE("Activate"), - DEACTIVATE("Deactivate"), - CHANGE_MODEL("ChangeModel"), - CREATE("Create"), - DELETE("Delete"), - UPDATE("Update"), - ADD_MEMBERS("AddMembers"), - REMOVE_MEMBERS("RemoveMembers"), - CUSTOM("Custom"); - - private final String name; - - private OrchestrationAction(String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } + ASSIGN("Assign"), UNASSIGN("Unassign"), ACTIVATE("Activate"), DEACTIVATE("Deactivate"), CHANGE_MODEL( + "ChangeModel"), CREATE("Create"), DELETE("Delete"), UPDATE( + "Update"), ADD_MEMBERS("AddMembers"), REMOVE_MEMBERS("RemoveMembers"), CUSTOM("Custom"); + + private final String name; + + private OrchestrationAction(String name) { + this.name = name; + } + + @Override + public String toString() { + return name; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java index 0fa07cfe0f..e608bfed21 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatus.java @@ -21,41 +21,37 @@ package org.onap.so.db.catalog.beans; public enum OrchestrationStatus { - ACTIVE("Active", "active"), - ASSIGNED("Assigned", "assigned"), - CREATED("Created", "created"), - INVENTORIED("Inventoried", "inventoried"), - PENDING("Pending", "pending"), - PENDING_ACTIVATION("PendingActivation", "pending.?activation"), - PENDING_CREATE("PendingCreate", "pending.?create"), - PENDING_DELETE("PendingDelete", "pending.?delete"), - PRECREATED("PreCreated", "pre.?created"), - CONFIGASSIGNED("ConfigAssigned", "config.?assigned"), - CONFIGURE("Configure" , "configure"), - CONFIGURED("Configured" , "configured"); + ACTIVE("Active", "active"), ASSIGNED("Assigned", "assigned"), CREATED("Created", "created"), INVENTORIED( + "Inventoried", "inventoried"), PENDING("Pending", "pending"), PENDING_ACTIVATION("PendingActivation", + "pending.?activation"), PENDING_CREATE("PendingCreate", "pending.?create"), PENDING_DELETE( + "PendingDelete", "pending.?delete"), PRECREATED("PreCreated", + "pre.?created"), CONFIGASSIGNED("ConfigAssigned", "config.?assigned"), CONFIGURE( + "Configure", "configure"), CONFIGURED("Configured", "configured"); - private final String name; - private final String fuzzyMatcher; - private OrchestrationStatus(String name, String fuzzyMatcher) { - this.name = name; - this.fuzzyMatcher = fuzzyMatcher; - } + private final String name; + private final String fuzzyMatcher; - @Override - public String toString() { - return name; - } - /** - * case insensitive regular expression match to enum value - * - * @param status - * @return - */ - public boolean fuzzyMap(String status) { - if (status != null) { - return status.matches("(?i)" + this.fuzzyMatcher); - } else { - return false; - } - } + private OrchestrationStatus(String name, String fuzzyMatcher) { + this.name = name; + this.fuzzyMatcher = fuzzyMatcher; + } + + @Override + public String toString() { + return name; + } + + /** + * case insensitive regular expression match to enum value + * + * @param status + * @return + */ + public boolean fuzzyMap(String status) { + if (status != null) { + return status.matches("(?i)" + this.fuzzyMatcher); + } else { + return false; + } + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusStateTransitionDirective.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusStateTransitionDirective.java index 245fcdcf92..fd3f387e3f 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusStateTransitionDirective.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusStateTransitionDirective.java @@ -21,7 +21,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.EnumType; @@ -30,105 +29,103 @@ import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; 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; @Entity @Table(name = "orchestration_status_state_transition_directive") public class OrchestrationStatusStateTransitionDirective implements Serializable { - private static final long serialVersionUID = -4626396955833442376L; - - @Id - @Column(name = "id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @Enumerated(EnumType.STRING) - @Column(name = "RESOURCE_TYPE") - @BusinessKey - private ResourceType resourceType; - - @Enumerated(EnumType.STRING) - @Column(name = "ORCHESTRATION_STATUS") - @BusinessKey - private OrchestrationStatus orchestrationStatus; - - @Enumerated(EnumType.STRING) - @Column(name = "TARGET_ACTION") - @BusinessKey - private OrchestrationAction targetAction; - - @Enumerated(EnumType.STRING) - @Column(name = "FLOW_DIRECTIVE") - @BusinessKey - private OrchestrationStatusValidationDirective flowDirective; - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("resourceType", resourceType) - .append("orchestrationStatus", orchestrationStatus).append("targetAction", targetAction) - .append("flowDirective", flowDirective).toString(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public ResourceType getResourceType() { - return resourceType; - } - - public void setResourceType(ResourceType resourceType) { - this.resourceType = resourceType; - } - - public OrchestrationStatus getOrchestrationStatus() { - return orchestrationStatus; - } - - public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) { - this.orchestrationStatus = orchestrationStatus; - } - - public OrchestrationAction getTargetAction() { - return targetAction; - } - - public void setTargetAction(OrchestrationAction targetAction) { - this.targetAction = targetAction; - } - - public OrchestrationStatusValidationDirective getFlowDirective() { - return flowDirective; - } - - public void setFlowDirective(OrchestrationStatusValidationDirective flowDirective) { - this.flowDirective = flowDirective; - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof OrchestrationStatusStateTransitionDirective)) { - return false; - } - OrchestrationStatusStateTransitionDirective castOther = (OrchestrationStatusStateTransitionDirective) other; - return new EqualsBuilder().append(getResourceType(), castOther.getResourceType()) - .append(getOrchestrationStatus(), castOther.getOrchestrationStatus()) - .append(getTargetAction(), castOther.getTargetAction()) - .append(getFlowDirective(), castOther.getFlowDirective()).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(getResourceType()).append(getOrchestrationStatus()) - .append(getTargetAction()).append(getFlowDirective()).toHashCode(); - } + private static final long serialVersionUID = -4626396955833442376L; + + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @Enumerated(EnumType.STRING) + @Column(name = "RESOURCE_TYPE") + @BusinessKey + private ResourceType resourceType; + + @Enumerated(EnumType.STRING) + @Column(name = "ORCHESTRATION_STATUS") + @BusinessKey + private OrchestrationStatus orchestrationStatus; + + @Enumerated(EnumType.STRING) + @Column(name = "TARGET_ACTION") + @BusinessKey + private OrchestrationAction targetAction; + + @Enumerated(EnumType.STRING) + @Column(name = "FLOW_DIRECTIVE") + @BusinessKey + private OrchestrationStatusValidationDirective flowDirective; + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("resourceType", resourceType) + .append("orchestrationStatus", orchestrationStatus).append("targetAction", targetAction) + .append("flowDirective", flowDirective).toString(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public ResourceType getResourceType() { + return resourceType; + } + + public void setResourceType(ResourceType resourceType) { + this.resourceType = resourceType; + } + + public OrchestrationStatus getOrchestrationStatus() { + return orchestrationStatus; + } + + public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) { + this.orchestrationStatus = orchestrationStatus; + } + + public OrchestrationAction getTargetAction() { + return targetAction; + } + + public void setTargetAction(OrchestrationAction targetAction) { + this.targetAction = targetAction; + } + + public OrchestrationStatusValidationDirective getFlowDirective() { + return flowDirective; + } + + public void setFlowDirective(OrchestrationStatusValidationDirective flowDirective) { + this.flowDirective = flowDirective; + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof OrchestrationStatusStateTransitionDirective)) { + return false; + } + OrchestrationStatusStateTransitionDirective castOther = (OrchestrationStatusStateTransitionDirective) other; + return new EqualsBuilder().append(getResourceType(), castOther.getResourceType()) + .append(getOrchestrationStatus(), castOther.getOrchestrationStatus()) + .append(getTargetAction(), castOther.getTargetAction()) + .append(getFlowDirective(), castOther.getFlowDirective()).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(getResourceType()).append(getOrchestrationStatus()) + .append(getTargetAction()).append(getFlowDirective()).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusValidationDirective.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusValidationDirective.java index f92aadf7a7..269a73e2c2 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusValidationDirective.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/OrchestrationStatusValidationDirective.java @@ -20,18 +20,18 @@ package org.onap.so.db.catalog.beans; -//TODO find this file a new location? +// TODO find this file a new location? public enum OrchestrationStatusValidationDirective { - SILENT_SUCCESS("SilentSuccess"), CONTINUE("Continue"), FAIL("Fail"), VALIDATION_SKIPPED("ValidationSkiPped"); + SILENT_SUCCESS("SilentSuccess"), CONTINUE("Continue"), FAIL("Fail"), VALIDATION_SKIPPED("ValidationSkiPped"); - private final String name; + private final String name; - private OrchestrationStatusValidationDirective(String name) { - this.name = name; - } + private OrchestrationStatusValidationDirective(String name) { + this.name = name; + } - @Override - public String toString() { - return name; - } + @Override + public String toString() { + return name; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResource.java index 5e9a07443f..cb3195bbac 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResource.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResource.java @@ -1,20 +1,15 @@ /* - * ============LICENSE_START======================================================= - * Copyright (C) 2019 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 + * ============LICENSE_START======================================================= Copyright (C) 2019 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. + * 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========================================================= + * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END========================================================= */ package org.onap.so.db.catalog.beans; @@ -88,11 +83,10 @@ public class PnfResource implements Serializable { @Override public String toString() { return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) - .append("modelName", modelName).append("modelVersion", modelVersion) - .append("toscaNodeType", toscaNodeType).append("description", description) - .append("orchestrationMode", orchestrationMode).append("created", created) - .append("pnfResourceCustomizations", pnfResourceCustomizations) - .toString(); + .append("modelName", modelName).append("modelVersion", modelVersion) + .append("toscaNodeType", toscaNodeType).append("description", description) + .append("orchestrationMode", orchestrationMode).append("created", created) + .append("pnfResourceCustomizations", pnfResourceCustomizations).toString(); } @Override diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java index 0c236897cb..fabbc5007f 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/PnfResourceCustomization.java @@ -1,20 +1,15 @@ /* - * ============LICENSE_START======================================================= - * Copyright (C) 2019 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 + * ============LICENSE_START======================================================= Copyright (C) 2019 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. + * 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========================================================= + * SPDX-License-Identifier: Apache-2.0 ============LICENSE_END========================================================= */ package org.onap.so.db.catalog.beans; @@ -91,12 +86,11 @@ public class PnfResourceCustomization implements Serializable { @Override public String toString() { return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("created", created) - .append("nfFunction", nfFunction) - .append("nfType", nfType).append("nfRole", nfRole).append("nfNamingCode", nfNamingCode) - .append("multiStageDesign", multiStageDesign).append("pnfResources", pnfResources) - .append("blueprintName", blueprintName).append("blueprintVersion", blueprintVersion) - .toString(); + .append("modelInstanceName", modelInstanceName).append("created", created) + .append("nfFunction", nfFunction).append("nfType", nfType).append("nfRole", nfRole) + .append("nfNamingCode", nfNamingCode).append("multiStageDesign", multiStageDesign) + .append("pnfResources", pnfResources).append("blueprintName", blueprintName) + .append("blueprintVersion", blueprintVersion).toString(); } @Override diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Recipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Recipe.java index ff6b713e6b..c030d44d81 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Recipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Recipe.java @@ -21,15 +21,15 @@ package org.onap.so.db.catalog.beans; public interface Recipe { - public Integer getId(); + public Integer getId(); - public String getAction(); + public String getAction(); - public String getDescription(); + public String getDescription(); - public String getParamXsd(); + public String getParamXsd(); - public String getOrchestrationUri(); + public String getOrchestrationUri(); - public Integer getRecipeTimeout(); + public Integer getRecipeTimeout(); } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java index 6d5c0fd9a8..b41548ca99 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ResourceType.java @@ -21,24 +21,18 @@ package org.onap.so.db.catalog.beans; public enum ResourceType { - SERVICE("Service"), - VNF("Vnf"), - VOLUME_GROUP("VolumeGroup"), - VF_MODULE("VfModule"), - NETWORK("Network"), - NETWORK_COLLECTION("NetworkCollection"), - CONFIGURATION("Configuration"), - INSTANCE_GROUP("InstanceGroup"), - NO_VALIDATE("NoValidate"); - - private final String name; - - private ResourceType(String name) { - this.name = name; - } - - @Override - public String toString() { - return name; - } + SERVICE("Service"), VNF("Vnf"), VOLUME_GROUP("VolumeGroup"), VF_MODULE("VfModule"), NETWORK( + "Network"), NETWORK_COLLECTION("NetworkCollection"), CONFIGURATION( + "Configuration"), INSTANCE_GROUP("InstanceGroup"), NO_VALIDATE("NoValidate"); + + private final String name; + + private ResourceType(String name) { + this.name = name; + } + + @Override + public String toString() { + return name; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServerType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServerType.java index 194215325b..92ba56cb4e 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServerType.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServerType.java @@ -21,5 +21,5 @@ package org.onap.so.db.catalog.beans; public enum ServerType { - KEYSTONE, ORM, KEYSTONE_V3; + KEYSTONE, ORM, KEYSTONE_V3; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java index 2a8e86c5b0..c333033ba2 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Service.java @@ -26,7 +26,6 @@ import java.util.Date; import java.util.List; import java.util.Map; import java.util.Set; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -41,14 +40,11 @@ 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 com.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @@ -98,36 +94,45 @@ public class Service implements Serializable { private String resourceOrder; @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "network_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) + @JoinTable(name = "network_resource_customization_to_service", + joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) private List<NetworkResourceCustomization> networkCustomizations; @OneToMany(cascade = CascadeType.ALL, mappedBy = "service") private List<VnfResourceCustomization> vnfCustomizations; @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "allotted_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) + @JoinTable(name = "allotted_resource_customization_to_service", + joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) private List<AllottedResourceCustomization> allottedCustomizations; @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "collection_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) + @JoinTable(name = "collection_resource_customization_to_service", + joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) private List<CollectionResourceCustomization> collectionResourceCustomizations; @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "service_proxy_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) + @JoinTable(name = "service_proxy_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) private List<ServiceProxyResourceCustomization> serviceProxyCustomizations; - + @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "configuration_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) + @JoinTable(name = "configuration_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) private List<ConfigurationResourceCustomization> configurationCustomizations; - + @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "pnf_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) + @JoinTable(name = "pnf_resource_customization_to_service", joinColumns = @JoinColumn(name = "SERVICE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "RESOURCE_MODEL_CUSTOMIZATION_UUID")) private List<PnfResourceCustomization> pnfCustomizations; @OneToMany(cascade = CascadeType.ALL, mappedBy = "service") @MapKey(name = "action") private Map<String, ServiceRecipe> recipes; - + @ManyToOne(cascade = CascadeType.ALL) @JoinColumn(name = "TOSCA_CSAR_ARTIFACT_UUID") private ToscaCsar csar; @@ -143,10 +148,9 @@ public class Service implements Serializable { .append("allottedCustomizations", allottedCustomizations) .append("collectionResourceCustomizations", collectionResourceCustomizations) .append("serviceProxyCustomizations", serviceProxyCustomizations) - .append("configurationCustomizations", configurationCustomizations) - .append("pnfCustomizations", pnfCustomizations) - .append("recipes", recipes) - .append("csar", csar).toString(); + .append("configurationCustomizations", configurationCustomizations) + .append("pnfCustomizations", pnfCustomizations).append("recipes", recipes).append("csar", csar) + .toString(); } @PrePersist diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceProxyResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceProxyResourceCustomization.java index d725c505ff..d8be423f5a 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceProxyResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceProxyResourceCustomization.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -40,162 +39,158 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "service_proxy_customization") public class ServiceProxyResourceCustomization implements Serializable { - /** - * - */ - private static final long serialVersionUID = -2822457299134903084L; - - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "SOURCE_SERVICE_MODEL_UUID") - private Service sourceService; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public Date getCreated() { - return created; - } - - @LinkedResource - public Service getSourceService() { - return sourceService; - } - - public void setSourceService(Service sourceService) { - this.sourceService = sourceService; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("toscaNodeType", toscaNodeType) - .append("modelUUID", modelUUID) - .append("modelInvariantUUID",modelInvariantUUID).append("modelName",modelName) - .append("description",description) - .append("created", created).append("sourceService", sourceService).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ServiceProxyResourceCustomization)) { - return false; - } - ServiceProxyResourceCustomization castOther = (ServiceProxyResourceCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); - } + /** + * + */ + private static final long serialVersionUID = -2822457299134903084L; + + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "SOURCE_SERVICE_MODEL_UUID") + private Service sourceService; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public Date getCreated() { + return created; + } + + @LinkedResource + public Service getSourceService() { + return sourceService; + } + + public void setSourceService(Service sourceService) { + this.sourceService = sourceService; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("toscaNodeType", toscaNodeType) + .append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) + .append("modelName", modelName).append("description", description).append("created", created) + .append("sourceService", sourceService).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ServiceProxyResourceCustomization)) { + return false; + } + ServiceProxyResourceCustomization castOther = (ServiceProxyResourceCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java index 79b27e7deb..5a241afc3a 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ServiceRecipe.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -34,168 +33,166 @@ 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 com.openpojo.business.annotation.BusinessKey; @Entity @Table(name = "service_recipe") public class ServiceRecipe implements Serializable, Recipe { - - private static final long serialVersionUID = 768026109321305392L; - - @Id - @Column(name = "id") - private Integer id; - - @BusinessKey - @Column(name = "SERVICE_MODEL_UUID") - private String serviceModelUUID; - - @BusinessKey - @Column(name = "ACTION") - private String action; - - @Column(name = "description") - private String description; - - @BusinessKey - @Column(name = "ORCHESTRATION_URI") - private String orchestrationUri; - - @Column(name = "SERVICE_PARAM_XSD") - private String paramXsd; - - @Column(name = "RECIPE_TIMEOUT") - private Integer recipeTimeout; - - @Column(name = "SERVICE_TIMEOUT_INTERIM") - private Integer serviceTimeoutInterim; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @BusinessKey - @ManyToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "SERVICE_MODEL_UUID", referencedColumnName = "MODEL_UUID",insertable = false, updatable = false) - private Service service; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("serviceModelUUID", serviceModelUUID) - .append("action", action).append("description", description) - .append("orchestrationUri", orchestrationUri).append("serviceParamXSD", paramXsd) - .append("recipeTimeout", recipeTimeout).append("serviceTimeoutInterim", serviceTimeoutInterim) - .append("created", created).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ServiceRecipe)) { - return false; - } - ServiceRecipe castOther = (ServiceRecipe) other; - return new EqualsBuilder().append(serviceModelUUID, castOther.serviceModelUUID).append(action, castOther.action) - .append(orchestrationUri, castOther.orchestrationUri).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(serviceModelUUID).append(action).append(orchestrationUri).toHashCode(); - } - - // This 'default' CTR is now needed for backward compatibility since a new - // CTR was added below - public ServiceRecipe() { - super(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public void setCreated(Date created) { - this.created = created; - } - - public String getServiceModelUUID() { - return serviceModelUUID; - } - - public void setServiceModelUUID(String serviceModelUUID) { - this.serviceModelUUID = serviceModelUUID; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getOrchestrationUri() { - return orchestrationUri; - } - - public void setOrchestrationUri(String orchestrationUri) { - this.orchestrationUri = orchestrationUri; - } - - public String getParamXsd() { - return paramXsd; - } - - public void setParamXsd(String paramXsd) { - this.paramXsd = paramXsd; - } - - public Integer getRecipeTimeout() { - return recipeTimeout; - } - - public void setRecipeTimeout(Integer recipeTimeout) { - this.recipeTimeout = recipeTimeout; - } - - public Integer getServiceTimeoutInterim() { - return serviceTimeoutInterim; - } - - public void setServiceTimeoutInterim(Integer serviceTimeoutInterim) { - this.serviceTimeoutInterim = serviceTimeoutInterim; - } - - public Service getService() { - return service; - } - - public void setService(Service service) { - this.service = service; - } - - public Date getCreated() { - return created; - } + + private static final long serialVersionUID = 768026109321305392L; + + @Id + @Column(name = "id") + private Integer id; + + @BusinessKey + @Column(name = "SERVICE_MODEL_UUID") + private String serviceModelUUID; + + @BusinessKey + @Column(name = "ACTION") + private String action; + + @Column(name = "description") + private String description; + + @BusinessKey + @Column(name = "ORCHESTRATION_URI") + private String orchestrationUri; + + @Column(name = "SERVICE_PARAM_XSD") + private String paramXsd; + + @Column(name = "RECIPE_TIMEOUT") + private Integer recipeTimeout; + + @Column(name = "SERVICE_TIMEOUT_INTERIM") + private Integer serviceTimeoutInterim; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @BusinessKey + @ManyToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "SERVICE_MODEL_UUID", referencedColumnName = "MODEL_UUID", insertable = false, updatable = false) + private Service service; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("serviceModelUUID", serviceModelUUID) + .append("action", action).append("description", description) + .append("orchestrationUri", orchestrationUri).append("serviceParamXSD", paramXsd) + .append("recipeTimeout", recipeTimeout).append("serviceTimeoutInterim", serviceTimeoutInterim) + .append("created", created).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ServiceRecipe)) { + return false; + } + ServiceRecipe castOther = (ServiceRecipe) other; + return new EqualsBuilder().append(serviceModelUUID, castOther.serviceModelUUID).append(action, castOther.action) + .append(orchestrationUri, castOther.orchestrationUri).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(serviceModelUUID).append(action).append(orchestrationUri).toHashCode(); + } + + // This 'default' CTR is now needed for backward compatibility since a new + // CTR was added below + public ServiceRecipe() { + super(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public void setCreated(Date created) { + this.created = created; + } + + public String getServiceModelUUID() { + return serviceModelUUID; + } + + public void setServiceModelUUID(String serviceModelUUID) { + this.serviceModelUUID = serviceModelUUID; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getOrchestrationUri() { + return orchestrationUri; + } + + public void setOrchestrationUri(String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + public String getParamXsd() { + return paramXsd; + } + + public void setParamXsd(String paramXsd) { + this.paramXsd = paramXsd; + } + + public Integer getRecipeTimeout() { + return recipeTimeout; + } + + public void setRecipeTimeout(Integer recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + public Integer getServiceTimeoutInterim() { + return serviceTimeoutInterim; + } + + public void setServiceTimeoutInterim(Integer serviceTimeoutInterim) { + this.serviceTimeoutInterim = serviceTimeoutInterim; + } + + public Service getService() { + return service; + } + + public void setService(Service service) { + this.service = service; + } + + public Date getCreated() { + return created; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/SubType.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/SubType.java index 3230d8427b..77663606a2 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/SubType.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/SubType.java @@ -21,14 +21,16 @@ package org.onap.so.db.catalog.beans; public enum SubType { - SUB_INTERFACE("SUB-INTERFACE"); - - private final String value; - SubType(String value){ - this.value = value; - } - @Override - public String toString() { - return this.value; - } + SUB_INTERFACE("SUB-INTERFACE"); + + private final String value; + + SubType(String value) { + this.value = value; + } + + @Override + public String toString() { + return this.value; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookup.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookup.java index 484a5a9e97..b037b926f1 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookup.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookup.java @@ -21,16 +21,13 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.IdClass; import javax.persistence.Table; - import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; - import com.openpojo.business.annotation.BusinessKey; @Entity @@ -38,82 +35,82 @@ import com.openpojo.business.annotation.BusinessKey; @IdClass(TempNetworkHeatTemplateLookupId.class) public class TempNetworkHeatTemplateLookup implements Serializable { - public static final long serialVersionUID = -1322322139926390329L; - - @BusinessKey - @Id - @Column(name = "NETWORK_RESOURCE_MODEL_NAME") - private String networkResourceModelName; - - @BusinessKey - @Id - @Column(name = "HEAT_TEMPLATE_ARTIFACT_UUID") - private String heatTemplateArtifactUuid; - - @Column(name = "AIC_VERSION_MIN") - private String aicVersionMin; - - @Column(name = "AIC_VERSION_MAX") - private String aicVersionMax; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof TempNetworkHeatTemplateLookup)) { - return false; - } - TempNetworkHeatTemplateLookup castOther = (TempNetworkHeatTemplateLookup) other; - return new EqualsBuilder().append(networkResourceModelName, castOther.networkResourceModelName) - .append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(networkResourceModelName).append(heatTemplateArtifactUuid).toHashCode(); - } - - public TempNetworkHeatTemplateLookup() { - super(); - } - - public String getNetworkResourceModelName() { - return this.networkResourceModelName; - } - - public void setNetworkResourceModelName(String networkResourceModelName) { - this.networkResourceModelName = networkResourceModelName; - } - - public String getHeatTemplateArtifactUuid() { - return this.heatTemplateArtifactUuid; - } - - public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { - this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; - } - - public String getAicVersionMin() { - return this.aicVersionMin; - } - - public void setAicVersionMin(String aicVersionMin) { - this.aicVersionMin = aicVersionMin; - } - - public String getAicVersionMax() { - return this.aicVersionMax; - } - - public void setAicVersionMax(String aicVersionMax) { - this.aicVersionMax = aicVersionMax; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("NetworkResourceModelName=" + this.networkResourceModelName); - sb.append("HeatTemplateArtifactUuid=" + this.heatTemplateArtifactUuid); - sb.append("aicVersionMin=" + this.aicVersionMin); - sb.append("aicVersionMax=" + this.aicVersionMax); - return sb.toString(); - } + public static final long serialVersionUID = -1322322139926390329L; + + @BusinessKey + @Id + @Column(name = "NETWORK_RESOURCE_MODEL_NAME") + private String networkResourceModelName; + + @BusinessKey + @Id + @Column(name = "HEAT_TEMPLATE_ARTIFACT_UUID") + private String heatTemplateArtifactUuid; + + @Column(name = "AIC_VERSION_MIN") + private String aicVersionMin; + + @Column(name = "AIC_VERSION_MAX") + private String aicVersionMax; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof TempNetworkHeatTemplateLookup)) { + return false; + } + TempNetworkHeatTemplateLookup castOther = (TempNetworkHeatTemplateLookup) other; + return new EqualsBuilder().append(networkResourceModelName, castOther.networkResourceModelName) + .append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(networkResourceModelName).append(heatTemplateArtifactUuid).toHashCode(); + } + + public TempNetworkHeatTemplateLookup() { + super(); + } + + public String getNetworkResourceModelName() { + return this.networkResourceModelName; + } + + public void setNetworkResourceModelName(String networkResourceModelName) { + this.networkResourceModelName = networkResourceModelName; + } + + public String getHeatTemplateArtifactUuid() { + return this.heatTemplateArtifactUuid; + } + + public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { + this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; + } + + public String getAicVersionMin() { + return this.aicVersionMin; + } + + public void setAicVersionMin(String aicVersionMin) { + this.aicVersionMin = aicVersionMin; + } + + public String getAicVersionMax() { + return this.aicVersionMax; + } + + public void setAicVersionMax(String aicVersionMax) { + this.aicVersionMax = aicVersionMax; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("NetworkResourceModelName=" + this.networkResourceModelName); + sb.append("HeatTemplateArtifactUuid=" + this.heatTemplateArtifactUuid); + sb.append("aicVersionMin=" + this.aicVersionMin); + sb.append("aicVersionMax=" + this.aicVersionMax); + return sb.toString(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookupId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookupId.java index 2be6fe4e12..ff48b7b195 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookupId.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/TempNetworkHeatTemplateLookupId.java @@ -21,58 +21,56 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - 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; public class TempNetworkHeatTemplateLookupId implements Serializable { - /** - * - */ - private static final long serialVersionUID = -3660507980620002091L; - @BusinessKey - private String networkResourceModelName; - @BusinessKey - private String heatTemplateArtifactUuid; + /** + * + */ + private static final long serialVersionUID = -3660507980620002091L; + @BusinessKey + private String networkResourceModelName; + @BusinessKey + private String heatTemplateArtifactUuid; - @Override - public String toString() { - return new ToStringBuilder(this).append("networkResourceModelName", networkResourceModelName) - .append("heatTemplateArtifactUuid", heatTemplateArtifactUuid).toString(); - } + @Override + public String toString() { + return new ToStringBuilder(this).append("networkResourceModelName", networkResourceModelName) + .append("heatTemplateArtifactUuid", heatTemplateArtifactUuid).toString(); + } - public String getNetworkResourceModelName() { - return networkResourceModelName; - } + public String getNetworkResourceModelName() { + return networkResourceModelName; + } - public void setNetworkResourceModelName(String networkResourceModelName) { - this.networkResourceModelName = networkResourceModelName; - } + public void setNetworkResourceModelName(String networkResourceModelName) { + this.networkResourceModelName = networkResourceModelName; + } - public String getHeatTemplateArtifactUuid() { - return heatTemplateArtifactUuid; - } + public String getHeatTemplateArtifactUuid() { + return heatTemplateArtifactUuid; + } - public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { - this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; - } + public void setHeatTemplateArtifactUuid(String heatTemplateArtifactUuid) { + this.heatTemplateArtifactUuid = heatTemplateArtifactUuid; + } - @Override - public boolean equals(final Object other) { - if (!(other instanceof TempNetworkHeatTemplateLookupId)) { - return false; - } - TempNetworkHeatTemplateLookupId castOther = (TempNetworkHeatTemplateLookupId) other; - return new EqualsBuilder().append(networkResourceModelName, castOther.networkResourceModelName) - .append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof TempNetworkHeatTemplateLookupId)) { + return false; + } + TempNetworkHeatTemplateLookupId castOther = (TempNetworkHeatTemplateLookupId) other; + return new EqualsBuilder().append(networkResourceModelName, castOther.networkResourceModelName) + .append(heatTemplateArtifactUuid, castOther.heatTemplateArtifactUuid).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(networkResourceModelName).append(heatTemplateArtifactUuid).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(networkResourceModelName).append(heatTemplateArtifactUuid).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ToscaCsar.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ToscaCsar.java index 567675044e..2f9b19ada0 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ToscaCsar.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/ToscaCsar.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -33,139 +32,135 @@ 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 com.fasterxml.jackson.annotation.JsonIgnore; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "tosca_csar") public class ToscaCsar implements Serializable { - private static final long serialVersionUID = 768026109321305392L; + private static final long serialVersionUID = 768026109321305392L; - @BusinessKey - @Id - @Column(name = "ARTIFACT_UUID") - private String artifactUUID; - - @Column(name = "NAME") - private String name; + @BusinessKey + @Id + @Column(name = "ARTIFACT_UUID") + private String artifactUUID; + + @Column(name = "NAME") + private String name; - @Column(name = "ARTIFACT_CHECKSUM") - private String artifactChecksum; + @Column(name = "ARTIFACT_CHECKSUM") + private String artifactChecksum; - @Column(name = "URL") - private String url; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @BusinessKey - @Column(name = "Version") - private String version; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "csar") - @JsonIgnore - private List<Service> services; - - @Override - public String toString() { - return new ToStringBuilder(this).append("artifactUUID", artifactUUID).append("name", name) - .append("artifactChecksum", artifactChecksum).append("url", url).append("description", description) - .append("created", created).append("version", version).append("services", services).toString(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof ToscaCsar)) { - return false; - } - ToscaCsar castOther = (ToscaCsar) other; - return new EqualsBuilder().append(artifactUUID, castOther.artifactUUID).append(version, castOther.version) - .isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(artifactUUID).append(version).toHashCode(); - } - - public ToscaCsar() { - } - - public String getArtifactUUID() { - return artifactUUID; - } - - public void setArtifactUUID(String artifactUUID) { - this.artifactUUID = artifactUUID; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getVersion() { - return version; - } - - public void setVersion(String version) { - this.version = version; - } - - public String getArtifactChecksum() { - return artifactChecksum; - } - - public void setArtifactChecksum(String artifactChecksum) { - this.artifactChecksum = artifactChecksum; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } - - @LinkedResource - public List<Service> getServices() { - return services; - } - - public void setServices(List<Service> services) { - this.services = services; - } + @Column(name = "URL") + private String url; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @BusinessKey + @Column(name = "Version") + private String version; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "csar") + @JsonIgnore + private List<Service> services; + + @Override + public String toString() { + return new ToStringBuilder(this).append("artifactUUID", artifactUUID).append("name", name) + .append("artifactChecksum", artifactChecksum).append("url", url).append("description", description) + .append("created", created).append("version", version).append("services", services).toString(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof ToscaCsar)) { + return false; + } + ToscaCsar castOther = (ToscaCsar) other; + return new EqualsBuilder().append(artifactUUID, castOther.artifactUUID).append(version, castOther.version) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(artifactUUID).append(version).toHashCode(); + } + + public ToscaCsar() {} + + public String getArtifactUUID() { + return artifactUUID; + } + + public void setArtifactUUID(String artifactUUID) { + this.artifactUUID = artifactUUID; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + + public String getArtifactChecksum() { + return artifactChecksum; + } + + public void setArtifactChecksum(String artifactChecksum) { + this.artifactChecksum = artifactChecksum; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } + + @LinkedResource + public List<Service> getServices() { + return services; + } + + public void setServices(List<Service> services) { + this.services = services; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java index 7d23717b2f..a20647d5c1 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/UserParameters.java @@ -4,7 +4,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -19,13 +18,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import org.hibernate.annotations.NotFound; import org.hibernate.annotations.NotFoundAction; import uk.co.blackpepper.bowman.annotation.LinkedResource; @@ -34,153 +30,153 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "USER_PARAMETERS") public class UserParameters implements Serializable { - private static final long serialVersionUID = -5036895978102778877L; - - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer ID; - - @BusinessKey - @Column(name = "NAME") - private String name; - - @Column(name = "PAYLOAD_LOCATION") - private String payloadLocation; - - @Column(name = "LABEL") - private String label; - - @Column(name = "TYPE") - private String type; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "IS_REQUIRED") - private Boolean isRequried; - - @Column(name = "MAX_LENGTH") - private Integer maxLength; - - @Column(name = "ALLOWABLE_CHARS") - private String allowableChars; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "userParameters") - private List<ActivitySpecUserParameters> activitySpecUserParameters; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public Integer getID() { - return ID; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @LinkedResource - public List<ActivitySpecUserParameters> getActivitySpecUserParameters() { - return activitySpecUserParameters; - } - - public void setActivitySpecUserParameters( - List<ActivitySpecUserParameters> activitySpecUserParameters) { - this.activitySpecUserParameters = activitySpecUserParameters; - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("name", name) - .append("ActivitySpecUserParameters", activitySpecUserParameters).toString(); - } - public String getPayloadLocation() { - return payloadLocation; - } - - public void setPayloadLocation(String payloadLocation) { - this.payloadLocation = payloadLocation; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Boolean getIsRequried() { - return isRequried; - } - - public void setIsRequried(Boolean isRequried) { - this.isRequried = isRequried; - } - - public Integer getMaxLength() { - return maxLength; - } - - public void setMaxLength(Integer maxLength) { - this.maxLength = maxLength; - } - - public String getAllowableChars() { - return allowableChars; - } - - public void setAllowableChars(String allowableChars) { - this.allowableChars = allowableChars; - } - - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof UserParameters)) { - return false; - } - UserParameters castOther = (UserParameters) other; - return new EqualsBuilder().append(name, castOther.name).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(name).toHashCode(); - } + private static final long serialVersionUID = -5036895978102778877L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer ID; + + @BusinessKey + @Column(name = "NAME") + private String name; + + @Column(name = "PAYLOAD_LOCATION") + private String payloadLocation; + + @Column(name = "LABEL") + private String label; + + @Column(name = "TYPE") + private String type; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "IS_REQUIRED") + private Boolean isRequried; + + @Column(name = "MAX_LENGTH") + private Integer maxLength; + + @Column(name = "ALLOWABLE_CHARS") + private String allowableChars; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "userParameters") + private List<ActivitySpecUserParameters> activitySpecUserParameters; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public Integer getID() { + return ID; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @LinkedResource + public List<ActivitySpecUserParameters> getActivitySpecUserParameters() { + return activitySpecUserParameters; + } + + public void setActivitySpecUserParameters(List<ActivitySpecUserParameters> activitySpecUserParameters) { + this.activitySpecUserParameters = activitySpecUserParameters; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("name", name) + .append("ActivitySpecUserParameters", activitySpecUserParameters).toString(); + } + + public String getPayloadLocation() { + return payloadLocation; + } + + public void setPayloadLocation(String payloadLocation) { + this.payloadLocation = payloadLocation; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Boolean getIsRequried() { + return isRequried; + } + + public void setIsRequried(Boolean isRequried) { + this.isRequried = isRequried; + } + + public Integer getMaxLength() { + return maxLength; + } + + public void setMaxLength(Integer maxLength) { + this.maxLength = maxLength; + } + + public String getAllowableChars() { + return allowableChars; + } + + public void setAllowableChars(String allowableChars) { + this.allowableChars = allowableChars; + } + + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof UserParameters)) { + return false; + } + UserParameters castOther = (UserParameters) other; + return new EqualsBuilder().append(name, castOther.name).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(name).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VFCInstanceGroup.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VFCInstanceGroup.java index e44309e258..ea7d1adad6 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VFCInstanceGroup.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VFCInstanceGroup.java @@ -27,8 +27,8 @@ import javax.persistence.Entity; @DiscriminatorValue(value = "VNFC") public class VFCInstanceGroup extends InstanceGroup { - /** - * - */ - private static final long serialVersionUID = -6254325954630189563L; + /** + * + */ + private static final long serialVersionUID = -6254325954630189563L; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModule.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModule.java index 7d53a0b843..0c7820f5f0 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModule.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VfModule.java @@ -24,7 +24,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -39,194 +38,192 @@ 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 com.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "vf_module") public class VfModule implements Serializable { - private static final long serialVersionUID = 768026109321305392L; - - @Id - @BusinessKey - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "IS_BASE") - private Boolean isBase; - - @OneToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "VOL_HEAT_TEMPLATE_ARTIFACT_UUID") - private HeatTemplate volumeHeatTemplate; - - @OneToOne(cascade = CascadeType.ALL) - @JoinColumn(name = "HEAT_TEMPLATE_ARTIFACT_UUID") - private HeatTemplate moduleHeatTemplate; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(cascade = CascadeType.ALL) - @JoinTable(name = "vf_module_to_heat_files", joinColumns = @JoinColumn(name = "VF_MODULE_MODEL_UUID"), inverseJoinColumns = @JoinColumn(name = "HEAT_FILES_ARTIFACT_UUID")) - private List<HeatFiles> heatFiles; - - @OneToMany(mappedBy = "vfModule") - private List<VfModuleCustomization> vfModuleCustomization; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "VNF_RESOURCE_MODEL_UUID") - private VnfResource vnfResources; - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) - .append("modelName", modelName).append("modelVersion", modelVersion).append("description", description) - .append("isBase", isBase).append("volumeHeatTemplate", volumeHeatTemplate) - .append("moduleHeatTemplate", moduleHeatTemplate).append("created", created) - .append("heatFiles", heatFiles).append("vfModuleCustomization", vfModuleCustomization) - .append("vnfResources", vnfResources).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VfModule)) { - return false; - } - VfModule castOther = (VfModule) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - @LinkedResource - public List<VfModuleCustomization> getVfModuleCustomization() { - if (vfModuleCustomization == null) - vfModuleCustomization = new ArrayList<>(); - - return vfModuleCustomization; - } - - public void setVfModuleCustomization(List<VfModuleCustomization> vfModuleCustomization) { - this.vfModuleCustomization = vfModuleCustomization; - } - - public String getModelName() { - return this.modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public Boolean getIsBase() { - return isBase; - } - - public void setIsBase(Boolean isBase) { - this.isBase = isBase; - } - - @LinkedResource - public List<HeatFiles> getHeatFiles() { - if (heatFiles == null) - heatFiles = new ArrayList<>(); - return heatFiles; - } - - public void setHeatFiles(List<HeatFiles> heatFiles) { - this.heatFiles = heatFiles; - } - - @LinkedResource - public VnfResource getVnfResources() { - return vnfResources; - } - - public void setVnfResources(VnfResource vnfResources) { - this.vnfResources = vnfResources; - } - - public String getDescription() { - return this.description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - @LinkedResource - public HeatTemplate getVolumeHeatTemplate() { - return volumeHeatTemplate; - } - - public void setVolumeHeatTemplate(HeatTemplate volumeHeatTemplate) { - this.volumeHeatTemplate = volumeHeatTemplate; - } - - @LinkedResource - public HeatTemplate getModuleHeatTemplate() { - return moduleHeatTemplate; - } - - public void setModuleHeatTemplate(HeatTemplate moduleHeatTemplate) { - this.moduleHeatTemplate = moduleHeatTemplate; - } + private static final long serialVersionUID = 768026109321305392L; + + @Id + @BusinessKey + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "IS_BASE") + private Boolean isBase; + + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "VOL_HEAT_TEMPLATE_ARTIFACT_UUID") + private HeatTemplate volumeHeatTemplate; + + @OneToOne(cascade = CascadeType.ALL) + @JoinColumn(name = "HEAT_TEMPLATE_ARTIFACT_UUID") + private HeatTemplate moduleHeatTemplate; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(cascade = CascadeType.ALL) + @JoinTable(name = "vf_module_to_heat_files", joinColumns = @JoinColumn(name = "VF_MODULE_MODEL_UUID"), + inverseJoinColumns = @JoinColumn(name = "HEAT_FILES_ARTIFACT_UUID")) + private List<HeatFiles> heatFiles; + + @OneToMany(mappedBy = "vfModule") + private List<VfModuleCustomization> vfModuleCustomization; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "VNF_RESOURCE_MODEL_UUID") + private VnfResource vnfResources; + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) + .append("modelName", modelName).append("modelVersion", modelVersion).append("description", description) + .append("isBase", isBase).append("volumeHeatTemplate", volumeHeatTemplate) + .append("moduleHeatTemplate", moduleHeatTemplate).append("created", created) + .append("heatFiles", heatFiles).append("vfModuleCustomization", vfModuleCustomization) + .append("vnfResources", vnfResources).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VfModule)) { + return false; + } + VfModule castOther = (VfModule) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + @LinkedResource + public List<VfModuleCustomization> getVfModuleCustomization() { + if (vfModuleCustomization == null) + vfModuleCustomization = new ArrayList<>(); + + return vfModuleCustomization; + } + + public void setVfModuleCustomization(List<VfModuleCustomization> vfModuleCustomization) { + this.vfModuleCustomization = vfModuleCustomization; + } + + public String getModelName() { + return this.modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public Boolean getIsBase() { + return isBase; + } + + public void setIsBase(Boolean isBase) { + this.isBase = isBase; + } + + @LinkedResource + public List<HeatFiles> getHeatFiles() { + if (heatFiles == null) + heatFiles = new ArrayList<>(); + return heatFiles; + } + + public void setHeatFiles(List<HeatFiles> heatFiles) { + this.heatFiles = heatFiles; + } + + @LinkedResource + public VnfResource getVnfResources() { + return vnfResources; + } + + public void setVnfResources(VnfResource vnfResources) { + this.vnfResources = vnfResources; + } + + public String getDescription() { + return this.description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + @LinkedResource + public HeatTemplate getVolumeHeatTemplate() { + return volumeHeatTemplate; + } + + public void setVolumeHeatTemplate(HeatTemplate volumeHeatTemplate) { + this.volumeHeatTemplate = volumeHeatTemplate; + } + + @LinkedResource + public HeatTemplate getModuleHeatTemplate() { + return moduleHeatTemplate; + } + + public void setModuleHeatTemplate(HeatTemplate moduleHeatTemplate) { + this.moduleHeatTemplate = moduleHeatTemplate; + } } 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; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfComponentsRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfComponentsRecipe.java index e4ac0d5816..58e7c6c61c 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfComponentsRecipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfComponentsRecipe.java @@ -21,151 +21,148 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; 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; @Entity @Table(name = "vnf_components_recipe") public class VnfComponentsRecipe implements Serializable, Recipe { - private static final long serialVersionUID = 768026109321305392L; + private static final long serialVersionUID = 768026109321305392L; - @Id - @Column(name = "id") - private Integer id; + @Id + @Column(name = "id") + private Integer id; - @BusinessKey - @Column(name = "ACTION") - private String action; + @BusinessKey + @Column(name = "ACTION") + private String action; - @Column(name = "DESCRIPTION") - private String description; - - @BusinessKey - @Column(name = "ORCHESTRATION_URI") - private String orchestrationUri; - - @Column(name = "RECIPE_TIMEOUT") - private Integer recipeTimeout; - - @BusinessKey - @Column(name = "VNF_TYPE") - private String vnfType; - - @Column(name = "VNF_COMPONENT_PARAM_XSD") - private String paramXsd; - - @Column(name = "VNF_COMPONENT_TYPE") - private String vnfComponentType; - - @BusinessKey - @Column(name = "VF_MODULE_MODEL_UUID") - private String vfModuleModelUUID; - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("action", action).append("description", description) - .append("orchestrationUri", orchestrationUri).append("recipeTimeout", recipeTimeout) - .append("vnfType", vnfType).append("paramXsd", paramXsd).append("vnfComponentType", vnfComponentType) - .append("vfModuleModelUUID", vfModuleModelUUID).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VnfComponentsRecipe)) { - return false; - } - VnfComponentsRecipe castOther = (VnfComponentsRecipe) other; - return new EqualsBuilder().append(action, castOther.action).append(orchestrationUri, castOther.orchestrationUri) - .append(vnfType, castOther.vnfType).append(vfModuleModelUUID, castOther.vfModuleModelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(action).append(orchestrationUri).append(vnfType).append(vfModuleModelUUID) - .toHashCode(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public void setOrchestrationUri(String orchestrationUri) { - this.orchestrationUri = orchestrationUri; - } - - public void setRecipeTimeout(Integer recipeTimeout) { - this.recipeTimeout = recipeTimeout; - } - - public String getVnfType() { - return vnfType; - } - - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - - public String getParamXsd() { - return paramXsd; - } - - public void setParamXsd(String paramXsd) { - this.paramXsd = paramXsd; - } - - public String getVnfComponentType() { - return vnfComponentType; - } - - public void setVnfComponentType(String vnfComponentType) { - this.vnfComponentType = vnfComponentType; - } - - public String getVfModuleModelUUID() { - return vfModuleModelUUID; - } - - public void setVfModuleModelUUID(String vfModuleModelUUID) { - this.vfModuleModelUUID = vfModuleModelUUID; - } - - @Override - public String getOrchestrationUri() { - return orchestrationUri; - } - - @Override - public Integer getRecipeTimeout() { - return recipeTimeout; - } + @Column(name = "DESCRIPTION") + private String description; + + @BusinessKey + @Column(name = "ORCHESTRATION_URI") + private String orchestrationUri; + + @Column(name = "RECIPE_TIMEOUT") + private Integer recipeTimeout; + + @BusinessKey + @Column(name = "VNF_TYPE") + private String vnfType; + + @Column(name = "VNF_COMPONENT_PARAM_XSD") + private String paramXsd; + + @Column(name = "VNF_COMPONENT_TYPE") + private String vnfComponentType; + + @BusinessKey + @Column(name = "VF_MODULE_MODEL_UUID") + private String vfModuleModelUUID; + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("action", action).append("description", description) + .append("orchestrationUri", orchestrationUri).append("recipeTimeout", recipeTimeout) + .append("vnfType", vnfType).append("paramXsd", paramXsd).append("vnfComponentType", vnfComponentType) + .append("vfModuleModelUUID", vfModuleModelUUID).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VnfComponentsRecipe)) { + return false; + } + VnfComponentsRecipe castOther = (VnfComponentsRecipe) other; + return new EqualsBuilder().append(action, castOther.action).append(orchestrationUri, castOther.orchestrationUri) + .append(vnfType, castOther.vnfType).append(vfModuleModelUUID, castOther.vfModuleModelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(action).append(orchestrationUri).append(vnfType).append(vfModuleModelUUID) + .toHashCode(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setOrchestrationUri(String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + public void setRecipeTimeout(Integer recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getParamXsd() { + return paramXsd; + } + + public void setParamXsd(String paramXsd) { + this.paramXsd = paramXsd; + } + + public String getVnfComponentType() { + return vnfComponentType; + } + + public void setVnfComponentType(String vnfComponentType) { + this.vnfComponentType = vnfComponentType; + } + + public String getVfModuleModelUUID() { + return vfModuleModelUUID; + } + + public void setVfModuleModelUUID(String vfModuleModelUUID) { + this.vfModuleModelUUID = vfModuleModelUUID; + } + + @Override + public String getOrchestrationUri() { + return orchestrationUri; + } + + @Override + public Integer getRecipeTimeout() { + return recipeTimeout; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfRecipe.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfRecipe.java index ab2eb622c1..8bf45b52c7 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfRecipe.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfRecipe.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; @@ -30,169 +29,167 @@ 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 com.openpojo.business.annotation.BusinessKey; @Entity @Table(name = "vnf_recipe") public class VnfRecipe implements Serializable, Recipe { - private static final long serialVersionUID = 768026109321305392L; - - @Id - @Column(name = "id") - private Integer id; - - @BusinessKey - @Column(name = "NF_ROLE") - private String nfRole; - - @Column(name = "VNF_PARAM_XSD") - private String paramXsd; - - @Column(name = "VF_MODULE_ID") - private String vfModuleId; - - @BusinessKey - @Column(name = "ACTION") - protected String action; - - @Column(name = "description") - private String description; - - @BusinessKey - @Column(name = "ORCHESTRATION_URI") - protected String orchestrationUri; - - @Column(name = "RECIPE_TIMEOUT") - private Integer recipeTimeout; - - @Column(name = "VERSION_STR") - private String versionStr; - - @BusinessKey - @Column(name = "SERVICE_TYPE") - private String serviceType; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("vnfType", nfRole).append("paramXsd", paramXsd) - .append("vfModuleId", vfModuleId).append("action", action).append("description", description) - .append("orchestrationUri", orchestrationUri).append("recipeTimeout", recipeTimeout) - .append("serviceType", serviceType).append("created", created).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VnfRecipe)) { - return false; - } - VnfRecipe castOther = (VnfRecipe) other; - return new EqualsBuilder().append(nfRole, castOther.nfRole).append(action, castOther.action) - .append(orchestrationUri, castOther.orchestrationUri).append(serviceType, castOther.serviceType) - .isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(nfRole).append(action).append(orchestrationUri).append(serviceType) - .toHashCode(); - } - - public String getNfRole() { - return nfRole; - } - - public void setNfRole(String nfRole) { - this.nfRole = nfRole; - } - - public String getParamXsd() { - return paramXsd; - } - - public void setParamXsd(String paramXsd) { - this.paramXsd = paramXsd; - } - - public String getVfModuleId() { - return vfModuleId; - } - - public void setVfModuleId(String vfModuleId) { - this.vfModuleId = vfModuleId; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getOrchestrationUri() { - return orchestrationUri; - } - - public void setOrchestrationUri(String orchestrationUri) { - this.orchestrationUri = orchestrationUri; - } - - public Integer getRecipeTimeout() { - return recipeTimeout; - } - - public void setRecipeTimeout(Integer recipeTimeout) { - this.recipeTimeout = recipeTimeout; - } - - public String getServiceType() { - return serviceType; - } - - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - public Date getCreated() { - return created; - } - - public String getVersionStr() { - return versionStr; - } - - public void setVersionStr(String versionStr) { - this.versionStr = versionStr; - } + private static final long serialVersionUID = 768026109321305392L; + + @Id + @Column(name = "id") + private Integer id; + + @BusinessKey + @Column(name = "NF_ROLE") + private String nfRole; + + @Column(name = "VNF_PARAM_XSD") + private String paramXsd; + + @Column(name = "VF_MODULE_ID") + private String vfModuleId; + + @BusinessKey + @Column(name = "ACTION") + protected String action; + + @Column(name = "description") + private String description; + + @BusinessKey + @Column(name = "ORCHESTRATION_URI") + protected String orchestrationUri; + + @Column(name = "RECIPE_TIMEOUT") + private Integer recipeTimeout; + + @Column(name = "VERSION_STR") + private String versionStr; + + @BusinessKey + @Column(name = "SERVICE_TYPE") + private String serviceType; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("vnfType", nfRole).append("paramXsd", paramXsd) + .append("vfModuleId", vfModuleId).append("action", action).append("description", description) + .append("orchestrationUri", orchestrationUri).append("recipeTimeout", recipeTimeout) + .append("serviceType", serviceType).append("created", created).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VnfRecipe)) { + return false; + } + VnfRecipe castOther = (VnfRecipe) other; + return new EqualsBuilder().append(nfRole, castOther.nfRole).append(action, castOther.action) + .append(orchestrationUri, castOther.orchestrationUri).append(serviceType, castOther.serviceType) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(nfRole).append(action).append(orchestrationUri).append(serviceType) + .toHashCode(); + } + + public String getNfRole() { + return nfRole; + } + + public void setNfRole(String nfRole) { + this.nfRole = nfRole; + } + + public String getParamXsd() { + return paramXsd; + } + + public void setParamXsd(String paramXsd) { + this.paramXsd = paramXsd; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getOrchestrationUri() { + return orchestrationUri; + } + + public void setOrchestrationUri(String orchestrationUri) { + this.orchestrationUri = orchestrationUri; + } + + public Integer getRecipeTimeout() { + return recipeTimeout; + } + + public void setRecipeTimeout(Integer recipeTimeout) { + this.recipeTimeout = recipeTimeout; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public Date getCreated() { + return created; + } + + public String getVersionStr() { + return versionStr; + } + + public void setVersionStr(String versionStr) { + this.versionStr = versionStr; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java index 41269fb010..5d9deb6c89 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResource.java @@ -24,7 +24,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -36,13 +35,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import org.hibernate.annotations.NotFound; import org.hibernate.annotations.NotFoundAction; import uk.co.blackpepper.bowman.annotation.LinkedResource; @@ -51,228 +47,225 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "vnf_resource") public class VnfResource implements Serializable { - private static final long serialVersionUID = 768026109321305392L; - - @BusinessKey - @Id - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "ORCHESTRATION_MODE") - private String orchestrationMode; - - @Column(name = "AIC_VERSION_MIN") - private String aicVersionMin; - - @Column(name = "AIC_VERSION_MAX") - private String aicVersionMax; - - @Column(name = "RESOURCE_CATEGORY") - private String category; - - @Column(name = "RESOURCE_SUB_CATEGORY") - private String subCategory; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @ManyToOne(fetch = FetchType.LAZY) - @NotFound(action = NotFoundAction.IGNORE) - @JoinColumn(name = "HEAT_TEMPLATE_ARTIFACT_UUID") - private HeatTemplate heatTemplates; - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResources") - private List<VnfResourceCustomization> vnfResourceCustomizations; - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResource") - private List<VnfResourceWorkflow> vnfResourceWorkflow; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) - .append("modelName", modelName).append("modelVersion", modelVersion) - .append("toscaNodeType", toscaNodeType).append("description", description) - .append("orchestrationMode", orchestrationMode).append("aicVersionMin", aicVersionMin) - .append("aicVersionMax", aicVersionMax).append("created", created) - .append("heatTemplates", heatTemplates).append("vnfResourceCustomizations", vnfResourceCustomizations) - .append("vnfResourceWorkflow",vnfResourceWorkflow) - .toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VnfResource)) { - return false; - } - VnfResource castOther = (VnfResource) other; - return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelUUID).toHashCode(); - } - - public String getOrchestrationMode() { - return orchestrationMode; - } - - public void setOrchestrationMode(String orchestrationMode) { - this.orchestrationMode = orchestrationMode; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } - - public String getAicVersionMin() { - return this.aicVersionMin; - } - - public void setAicVersionMin(String aicVersionMin) { - this.aicVersionMin = aicVersionMin; - } - - public String getAicVersionMax() { - return this.aicVersionMax; - } - - public void setAicVersionMax(String aicVersionMax) { - this.aicVersionMax = aicVersionMax; - } - - /** - * @return Returns the category. - */ - public String getCategory() { - return category; - } - - /** - * @param category - * The category to set. - */ - public void setCategory(String category) { - this.category = category; - } - - /** - * @return Returns the subCategory. - */ - public String getSubCategory() { - return subCategory; - } - - /** - * @param subCategory - * The subCategory to set. - */ - public void setSubCategory(String subCategory) { - this.subCategory = subCategory; - } - - public String getModelInvariantUUID() { - return this.modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelInvariantId() { - return this.modelInvariantUUID; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - @LinkedResource - public List<VnfResourceCustomization> getVnfResourceCustomizations() { - if (vnfResourceCustomizations == null) - vnfResourceCustomizations = new ArrayList<>(); - return vnfResourceCustomizations; - } - - public void setVnfResourceCustomizations(List<VnfResourceCustomization> vnfResourceCustomizations) { - this.vnfResourceCustomizations = vnfResourceCustomizations; - } - - @LinkedResource - public HeatTemplate getHeatTemplates() { - return heatTemplates; - } - - public void setHeatTemplates(HeatTemplate heatTemplates) { - this.heatTemplates = heatTemplates; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - @LinkedResource - public List<VnfResourceWorkflow> getVnfResourceWorkflow() { - if (vnfResourceWorkflow == null) - vnfResourceWorkflow = new ArrayList<>(); - return vnfResourceWorkflow; - } - - public void setVnfResourceWorkflow(List<VnfResourceWorkflow> vnfResourceWorkflow) { - this.vnfResourceWorkflow = vnfResourceWorkflow; - } + private static final long serialVersionUID = 768026109321305392L; + + @BusinessKey + @Id + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "ORCHESTRATION_MODE") + private String orchestrationMode; + + @Column(name = "AIC_VERSION_MIN") + private String aicVersionMin; + + @Column(name = "AIC_VERSION_MAX") + private String aicVersionMax; + + @Column(name = "RESOURCE_CATEGORY") + private String category; + + @Column(name = "RESOURCE_SUB_CATEGORY") + private String subCategory; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @ManyToOne(fetch = FetchType.LAZY) + @NotFound(action = NotFoundAction.IGNORE) + @JoinColumn(name = "HEAT_TEMPLATE_ARTIFACT_UUID") + private HeatTemplate heatTemplates; + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResources") + private List<VnfResourceCustomization> vnfResourceCustomizations; + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResource") + private List<VnfResourceWorkflow> vnfResourceWorkflow; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelUUID", modelUUID).append("modelInvariantUUID", modelInvariantUUID) + .append("modelName", modelName).append("modelVersion", modelVersion) + .append("toscaNodeType", toscaNodeType).append("description", description) + .append("orchestrationMode", orchestrationMode).append("aicVersionMin", aicVersionMin) + .append("aicVersionMax", aicVersionMax).append("created", created) + .append("heatTemplates", heatTemplates).append("vnfResourceCustomizations", vnfResourceCustomizations) + .append("vnfResourceWorkflow", vnfResourceWorkflow).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VnfResource)) { + return false; + } + VnfResource castOther = (VnfResource) other; + return new EqualsBuilder().append(modelUUID, castOther.modelUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelUUID).toHashCode(); + } + + public String getOrchestrationMode() { + return orchestrationMode; + } + + public void setOrchestrationMode(String orchestrationMode) { + this.orchestrationMode = orchestrationMode; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } + + public String getAicVersionMin() { + return this.aicVersionMin; + } + + public void setAicVersionMin(String aicVersionMin) { + this.aicVersionMin = aicVersionMin; + } + + public String getAicVersionMax() { + return this.aicVersionMax; + } + + public void setAicVersionMax(String aicVersionMax) { + this.aicVersionMax = aicVersionMax; + } + + /** + * @return Returns the category. + */ + public String getCategory() { + return category; + } + + /** + * @param category The category to set. + */ + public void setCategory(String category) { + this.category = category; + } + + /** + * @return Returns the subCategory. + */ + public String getSubCategory() { + return subCategory; + } + + /** + * @param subCategory The subCategory to set. + */ + public void setSubCategory(String subCategory) { + this.subCategory = subCategory; + } + + public String getModelInvariantUUID() { + return this.modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelInvariantId() { + return this.modelInvariantUUID; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + @LinkedResource + public List<VnfResourceCustomization> getVnfResourceCustomizations() { + if (vnfResourceCustomizations == null) + vnfResourceCustomizations = new ArrayList<>(); + return vnfResourceCustomizations; + } + + public void setVnfResourceCustomizations(List<VnfResourceCustomization> vnfResourceCustomizations) { + this.vnfResourceCustomizations = vnfResourceCustomizations; + } + + @LinkedResource + public HeatTemplate getHeatTemplates() { + return heatTemplates; + } + + public void setHeatTemplates(HeatTemplate heatTemplates) { + this.heatTemplates = heatTemplates; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + @LinkedResource + public List<VnfResourceWorkflow> getVnfResourceWorkflow() { + if (vnfResourceWorkflow == null) + vnfResourceWorkflow = new ArrayList<>(); + return vnfResourceWorkflow; + } + + public void setVnfResourceWorkflow(List<VnfResourceWorkflow> vnfResourceWorkflow) { + this.vnfResourceWorkflow = vnfResourceWorkflow; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java index 1cbc7b561f..af99aa8c80 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceCustomization.java @@ -26,7 +26,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; @@ -42,14 +41,11 @@ 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 com.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @@ -57,13 +53,13 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; public class VnfResourceCustomization implements Serializable { private static final long serialVersionUID = 768026109321305392L; - + @Id @BusinessKey @Column(name = "ID") @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; - + @Column(name = "MODEL_CUSTOMIZATION_UUID") private String modelCustomizationUUID; @@ -105,17 +101,17 @@ public class VnfResourceCustomization implements Serializable { @ManyToOne(cascade = CascadeType.ALL) @JoinColumn(name = "VNF_RESOURCE_MODEL_UUID") private VnfResource vnfResources; - + @ManyToOne(cascade = CascadeType.ALL) @JoinColumn(name = "SERVICE_MODEL_UUID") private Service service; - @OneToMany(cascade = CascadeType.ALL,fetch = FetchType.EAGER, mappedBy = "vnfCustomization") + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "vnfCustomization") private List<VfModuleCustomization> vfModuleCustomizations; @OneToMany(fetch = FetchType.LAZY, mappedBy = "vnfResourceCust") private List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations = new ArrayList<>(); - + @Column(name = "CDS_BLUEPRINT_NAME") private String blueprintName; @@ -175,7 +171,7 @@ public class VnfResourceCustomization implements Serializable { public void setId(Integer id) { this.id = id; } - + @LinkedResource public Service getService() { return service; @@ -295,7 +291,7 @@ public class VnfResourceCustomization implements Serializable { List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations) { this.vnfcInstanceGroupCustomizations = vnfcInstanceGroupCustomizations; } - + public String getResourceInput() { return resourceInput; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java index 8790e738ef..f49ae26305 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflow.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -37,101 +36,97 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @IdClass(VnfResourceWorkflowId.class) @Table(name = "VNF_RESOURCE_TO_WORKFLOW") public class VnfResourceWorkflow implements Serializable { - - private static final long serialVersionUID = -1326433350241927676L; - - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer ID; - - @BusinessKey - @Id - @Column(name = "VNF_RESOURCE_MODEL_UUID") - private String vnfResourceModelUUID; - - @BusinessKey - @Id - @Column(name = "WORKFLOW_ID") - private Integer workflowId; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "VNF_RESOURCE_MODEL_UUID", updatable = false, insertable = false) - private VnfResource vnfResource; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "WORKFLOW_ID", updatable = false, insertable = false) - private Workflow workflow; - - @Override - public String toString() { - return new ToStringBuilder(this).append("vnfResourceModelUUID", vnfResourceModelUUID) - .append("workflowId", workflowId) - .toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VnfResourceWorkflow)) { - return false; - } - VnfResourceWorkflow castOther = (VnfResourceWorkflow) other; - return new EqualsBuilder().append(vnfResourceModelUUID, castOther.vnfResourceModelUUID) - .append(workflowId, castOther.workflowId).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(vnfResourceModelUUID).append(workflowId).toHashCode(); - } - - public Integer getID() { - return ID; - } - - public String getVnfResourceModelUUID() { - return vnfResourceModelUUID; - } - - public void setVnfResourceModelUUID(String vnfResourceModelUUID) { - this.vnfResourceModelUUID = vnfResourceModelUUID; - } - - public Integer getWorkflowId() { - return workflowId; - } - - public void setWorkflowId(Integer workflowId) { - this.workflowId = workflowId; - } - - public VnfResource getVnfResource() { - return vnfResource; - } - - public void setVnfResource(VnfResource vnfResource) { - this.vnfResource = vnfResource; - } - - public Workflow getWorkflow() { - return workflow; - } - - public void setWorkflow(Workflow workflow) { - this.workflow = workflow; - } - + + private static final long serialVersionUID = -1326433350241927676L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer ID; + + @BusinessKey + @Id + @Column(name = "VNF_RESOURCE_MODEL_UUID") + private String vnfResourceModelUUID; + + @BusinessKey + @Id + @Column(name = "WORKFLOW_ID") + private Integer workflowId; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "VNF_RESOURCE_MODEL_UUID", updatable = false, insertable = false) + private VnfResource vnfResource; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "WORKFLOW_ID", updatable = false, insertable = false) + private Workflow workflow; + + @Override + public String toString() { + return new ToStringBuilder(this).append("vnfResourceModelUUID", vnfResourceModelUUID) + .append("workflowId", workflowId).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VnfResourceWorkflow)) { + return false; + } + VnfResourceWorkflow castOther = (VnfResourceWorkflow) other; + return new EqualsBuilder().append(vnfResourceModelUUID, castOther.vnfResourceModelUUID) + .append(workflowId, castOther.workflowId).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(vnfResourceModelUUID).append(workflowId).toHashCode(); + } + + public Integer getID() { + return ID; + } + + public String getVnfResourceModelUUID() { + return vnfResourceModelUUID; + } + + public void setVnfResourceModelUUID(String vnfResourceModelUUID) { + this.vnfResourceModelUUID = vnfResourceModelUUID; + } + + public Integer getWorkflowId() { + return workflowId; + } + + public void setWorkflowId(Integer workflowId) { + this.workflowId = workflowId; + } + + public VnfResource getVnfResource() { + return vnfResource; + } + + public void setVnfResource(VnfResource vnfResource) { + this.vnfResource = vnfResource; + } + + public Workflow getWorkflow() { + return workflow; + } + + public void setWorkflow(Workflow workflow) { + this.workflow = workflow; + } + } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflowId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflowId.java index ad8aa0587d..837b9c09b2 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflowId.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfResourceWorkflowId.java @@ -21,61 +21,64 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - 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; public class VnfResourceWorkflowId implements Serializable { - - private static final long serialVersionUID = -594459957997483601L; - - private Integer ID; - @BusinessKey - private String vnfResourceModelUUID; - @BusinessKey - private Integer workflowId; - - public String getVnfResourceModelUUID() { - return vnfResourceModelUUID; - } - public void setVnfResourceModelUUID(String vnfResourceModelUUID) { - this.vnfResourceModelUUID = vnfResourceModelUUID; - } - public Integer getWorkflowId() { - return workflowId; - } - public void setWorkflowId(Integer workflowId) { - this.workflowId = workflowId; - } - public Integer getID() { - return ID; - } - public void setID(Integer ID) { - this.ID = ID; - } + private static final long serialVersionUID = -594459957997483601L; + + private Integer ID; + + @BusinessKey + private String vnfResourceModelUUID; + @BusinessKey + private Integer workflowId; + + public String getVnfResourceModelUUID() { + return vnfResourceModelUUID; + } + + public void setVnfResourceModelUUID(String vnfResourceModelUUID) { + this.vnfResourceModelUUID = vnfResourceModelUUID; + } + + public Integer getWorkflowId() { + return workflowId; + } + + public void setWorkflowId(Integer workflowId) { + this.workflowId = workflowId; + } + + public Integer getID() { + return ID; + } + + public void setID(Integer ID) { + this.ID = ID; + } - @Override - public String toString() { - return new ToStringBuilder(this).append("vnfResourceModelUUID", vnfResourceModelUUID) - .append("workflowId", workflowId).toString(); - } + @Override + public String toString() { + return new ToStringBuilder(this).append("vnfResourceModelUUID", vnfResourceModelUUID) + .append("workflowId", workflowId).toString(); + } - @Override - public boolean equals(final Object other) { - if (!(other instanceof VnfResourceWorkflowId)) { - return false; - } - VnfResourceWorkflowId castOther = (VnfResourceWorkflowId) other; - return new EqualsBuilder().append(vnfResourceModelUUID, castOther.vnfResourceModelUUID) - .append(workflowId, castOther.workflowId).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof VnfResourceWorkflowId)) { + return false; + } + VnfResourceWorkflowId castOther = (VnfResourceWorkflowId) other; + return new EqualsBuilder().append(vnfResourceModelUUID, castOther.vnfResourceModelUUID) + .append(workflowId, castOther.workflowId).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(vnfResourceModelUUID).append(workflowId).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(vnfResourceModelUUID).append(workflowId).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcCustomization.java index 8534242a58..f6ae503c61 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcCustomization.java @@ -23,7 +23,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -33,7 +32,6 @@ import javax.persistence.PrePersist; import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; - import com.fasterxml.jackson.annotation.JsonFormat; import com.openpojo.business.annotation.BusinessKey; import org.apache.commons.lang3.builder.HashCodeBuilder; @@ -44,148 +42,148 @@ import org.apache.commons.lang3.builder.ToStringBuilder; @Table(name = "vnfc_customization") public class VnfcCustomization implements Serializable { - private static final long serialVersionUID = -3772469944364616486L; - - @BusinessKey - @Id - @Column(name = "MODEL_CUSTOMIZATION_UUID") - private String modelCustomizationUUID; - - @Column(name = "MODEL_INSTANCE_NAME") - private String modelInstanceName; - - @Column(name = "MODEL_UUID") - private String modelUUID; - - @Column(name = "MODEL_INVARIANT_UUID") - private String modelInvariantUUID; - - @Column(name = "MODEL_VERSION") - private String modelVersion; - - @Column(name = "MODEL_NAME") - private String modelName; - - @Column(name = "TOSCA_NODE_TYPE") - private String toscaNodeType; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(cascade = CascadeType.ALL, mappedBy = "vnfcCustomization") - private List<CvnfcCustomization> cvnfcCustomization; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VnfcCustomization)) { - return false; - } - VnfcCustomization castOther = (VnfcCustomization) other; - return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) - .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID) - .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) - .append("modelName", modelName).append("toscaNodeType", toscaNodeType) - .append("description", description).append("created", created) - .append("cvnfcCustomization", cvnfcCustomization).toString(); - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public String getModelCustomizationUUID() { - return modelCustomizationUUID; - } - - public void setModelCustomizationUUID(String modelCustomizationUUID) { - this.modelCustomizationUUID = modelCustomizationUUID; - } - - public String getModelInstanceName() { - return modelInstanceName; - } - - public void setModelInstanceName(String modelInstanceName) { - this.modelInstanceName = modelInstanceName; - } - - public String getModelUUID() { - return modelUUID; - } - - public void setModelUUID(String modelUUID) { - this.modelUUID = modelUUID; - } - - public String getModelInvariantUUID() { - return modelInvariantUUID; - } - - public void setModelInvariantUUID(String modelInvariantUUID) { - this.modelInvariantUUID = modelInvariantUUID; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getToscaNodeType() { - return toscaNodeType; - } - - public void setToscaNodeType(String toscaNodeType) { - this.toscaNodeType = toscaNodeType; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } - - public List<CvnfcCustomization> getCvnfcCustomization() { - return cvnfcCustomization; - } - - public void setCvnfcCustomization(List<CvnfcCustomization> cvnfcCustomization) { - this.cvnfcCustomization = cvnfcCustomization; - } + private static final long serialVersionUID = -3772469944364616486L; + + @BusinessKey + @Id + @Column(name = "MODEL_CUSTOMIZATION_UUID") + private String modelCustomizationUUID; + + @Column(name = "MODEL_INSTANCE_NAME") + private String modelInstanceName; + + @Column(name = "MODEL_UUID") + private String modelUUID; + + @Column(name = "MODEL_INVARIANT_UUID") + private String modelInvariantUUID; + + @Column(name = "MODEL_VERSION") + private String modelVersion; + + @Column(name = "MODEL_NAME") + private String modelName; + + @Column(name = "TOSCA_NODE_TYPE") + private String toscaNodeType; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS") + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(cascade = CascadeType.ALL, mappedBy = "vnfcCustomization") + private List<CvnfcCustomization> cvnfcCustomization; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VnfcCustomization)) { + return false; + } + VnfcCustomization castOther = (VnfcCustomization) other; + return new EqualsBuilder().append(modelCustomizationUUID, castOther.modelCustomizationUUID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(modelCustomizationUUID).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("modelCustomizationUUID", modelCustomizationUUID) + .append("modelInstanceName", modelInstanceName).append("modelUUID", modelUUID) + .append("modelInvariantUUID", modelInvariantUUID).append("modelVersion", modelVersion) + .append("modelName", modelName).append("toscaNodeType", toscaNodeType) + .append("description", description).append("created", created) + .append("cvnfcCustomization", cvnfcCustomization).toString(); + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public String getModelCustomizationUUID() { + return modelCustomizationUUID; + } + + public void setModelCustomizationUUID(String modelCustomizationUUID) { + this.modelCustomizationUUID = modelCustomizationUUID; + } + + public String getModelInstanceName() { + return modelInstanceName; + } + + public void setModelInstanceName(String modelInstanceName) { + this.modelInstanceName = modelInstanceName; + } + + public String getModelUUID() { + return modelUUID; + } + + public void setModelUUID(String modelUUID) { + this.modelUUID = modelUUID; + } + + public String getModelInvariantUUID() { + return modelInvariantUUID; + } + + public void setModelInvariantUUID(String modelInvariantUUID) { + this.modelInvariantUUID = modelInvariantUUID; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } + + public String getToscaNodeType() { + return toscaNodeType; + } + + public void setToscaNodeType(String toscaNodeType) { + this.toscaNodeType = toscaNodeType; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } + + public List<CvnfcCustomization> getCvnfcCustomization() { + return cvnfcCustomization; + } + + public void setCvnfcCustomization(List<CvnfcCustomization> cvnfcCustomization) { + this.cvnfcCustomization = cvnfcCustomization; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java index db1c929f9d..695e5bbbb9 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/VnfcInstanceGroupCustomization.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -37,13 +36,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @@ -51,108 +47,107 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "vnfc_instance_group_customization") public class VnfcInstanceGroupCustomization implements Serializable { - /** - * - */ - private static final long serialVersionUID = -8288218040186901676L; - - @Id - @BusinessKey - @Column(name = "ID") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "VNF_RESOURCE_CUSTOMIZATION_ID") - private VnfResourceCustomization vnfResourceCust; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID") - private InstanceGroup instanceGroup; - - @Column(name = "FUNCTION") - private String function; - - @Column(name = "DESCRIPTION") - private String description; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @Override - public boolean equals(final Object other) { - if (!(other instanceof VnfcInstanceGroupCustomization)) { - return false; - } - VnfcInstanceGroupCustomization castOther = (VnfcInstanceGroupCustomization) other; - return new EqualsBuilder().append(id, castOther.id).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(id).toHashCode(); - } - - @Override - public String toString() { - return new ToStringBuilder(this) - .append("function", function).append("description", description) - .append("created", created).toString(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public Date getCreated(){ - return created; - } - - public String getFunction() { - return function; - } - - public void setFunction(String function) { - this.function = function; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public void setCreated(Date created) { - this.created = created; - } - - @LinkedResource - public VnfResourceCustomization getVnfResourceCust() { - return vnfResourceCust; - } - - public void setVnfResourceCust(VnfResourceCustomization vnfResourceCust) { - this.vnfResourceCust = vnfResourceCust; - } - - @LinkedResource - public InstanceGroup getInstanceGroup() { - return instanceGroup; - } - - public void setInstanceGroup(InstanceGroup instanceGroup) { - this.instanceGroup = instanceGroup; - } + /** + * + */ + private static final long serialVersionUID = -8288218040186901676L; + + @Id + @BusinessKey + @Column(name = "ID") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "VNF_RESOURCE_CUSTOMIZATION_ID") + private VnfResourceCustomization vnfResourceCust; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "INSTANCE_GROUP_MODEL_UUID") + private InstanceGroup instanceGroup; + + @Column(name = "FUNCTION") + private String function; + + @Column(name = "DESCRIPTION") + private String description; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @Override + public boolean equals(final Object other) { + if (!(other instanceof VnfcInstanceGroupCustomization)) { + return false; + } + VnfcInstanceGroupCustomization castOther = (VnfcInstanceGroupCustomization) other; + return new EqualsBuilder().append(id, castOther.id).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(id).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("function", function).append("description", description) + .append("created", created).toString(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public Date getCreated() { + return created; + } + + public String getFunction() { + return function; + } + + public void setFunction(String function) { + this.function = function; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public void setCreated(Date created) { + this.created = created; + } + + @LinkedResource + public VnfResourceCustomization getVnfResourceCust() { + return vnfResourceCust; + } + + public void setVnfResourceCust(VnfResourceCustomization vnfResourceCust) { + this.vnfResourceCust = vnfResourceCust; + } + + @LinkedResource + public InstanceGroup getInstanceGroup() { + return instanceGroup; + } + + public void setInstanceGroup(InstanceGroup instanceGroup) { + this.instanceGroup = instanceGroup; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java index cdbf41747c..1f46bc01f7 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/Workflow.java @@ -4,7 +4,6 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Date; import java.util.List; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -19,13 +18,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import org.hibernate.annotations.NotFound; import org.hibernate.annotations.NotFoundAction; import uk.co.blackpepper.bowman.annotation.LinkedResource; @@ -34,203 +30,202 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "workflow") public class Workflow implements Serializable { - private static final long serialVersionUID = 1485794141983033264L; - - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer ID; - - @Column(name = "ARTIFACT_UUID") - private String artifactUUID; - - @Column(name = "ARTIFACT_NAME") - private String artifactName; - - @Column(name = "NAME") - private String name; - - @Column(name = "OPERATION_NAME") - private String operationName; - - @Column(name = "VERSION") - private Double version; - - @Column(name = "DESCRIPTION") - private String description; - - @Lob - @Column(name = "BODY", columnDefinition = "LONGTEXT") - private String body = null; - - @Column(name = "RESOURCE_TARGET") - private String resourceTarget; - - @Column(name = "SOURCE") - private String source; - - @Column(name = "TIMEOUT_MINUTES") - private Integer timeoutMinutes; - - @Column(name = "ARTIFACT_CHECKSUM") - private String artifactChecksum; - - @Column(name = "CREATION_TIMESTAMP", updatable = false) - @Temporal(TemporalType.TIMESTAMP) - private Date created; - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "workflow") - private List<VnfResourceWorkflow> vnfResourceWorkflow; - - @OneToMany(fetch = FetchType.LAZY, mappedBy = "workflow") - private List<WorkflowActivitySpecSequence> workflowActivitySpecSequence; - - @PrePersist - protected void onCreate() { - this.created = new Date(); - } - - public Integer getID() { - return ID; - } - - public String getArtifactUUID() { - return artifactUUID; - } - - public void setArtifactUUID(String artifactUUID) { - this.artifactUUID = artifactUUID; - } - - public String getArtifactName() { - return artifactName; - } - - public void setArtifactName(String artifactName) { - this.artifactName = artifactName; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getOperationName() { - return operationName; - } - - public void setOperationName(String operationName) { - this.operationName = operationName; - } - - public Double getVersion() { - return version; - } - - public void setVersion(Double version) { - this.version = version; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getBody() { - return body; - } - - public void setBody(String body) { - this.body = body; - } - - public String getResourceTarget() { - return resourceTarget; - } - - public void setResourceTarget(String resourceTarget) { - this.resourceTarget = resourceTarget; - } - - public String getSource() { - return source; - } - - public void setSource(String source) { - this.source = source; - } - - public Integer getTimeoutMinutes() { - return timeoutMinutes; - } - - public void setTimeoutMinutes(Integer timeoutMinutes) { - this.timeoutMinutes = timeoutMinutes; - } - - public String getArtifactChecksum() { - return artifactChecksum; - } - - public void setArtifactChecksum(String artifactChecksum) { - this.artifactChecksum = artifactChecksum; - } - - public Date getCreated() { - return created; - } - - public void setCreated(Date created) { - this.created = created; - } - - @LinkedResource - public List<VnfResourceWorkflow> getVnfResourceWorkflow() { - return vnfResourceWorkflow; - } - - public void setVnfResourceWorkflow( - List<VnfResourceWorkflow> vnfResourceWorkflow) { - this.vnfResourceWorkflow = vnfResourceWorkflow; - } - - @LinkedResource - public List<WorkflowActivitySpecSequence> getWorkflowActivitySpecSequence() { - return workflowActivitySpecSequence; - } - - public void setWorkflowActivitySpecSequence( - List<WorkflowActivitySpecSequence> workflowActivitySpecSequence) { - this.workflowActivitySpecSequence = workflowActivitySpecSequence; - } - - @Override - public String toString() { - return new ToStringBuilder(this).append("ID", ID).append("artifactUUID", artifactUUID) - .append("artifactName", artifactName).append("name", name) - .append("operationName", operationName).append("version", version).append("description", description) - .append("body",body).append("resourceTarget",resourceTarget).append("source", source) - .append("timeoutMinutes", timeoutMinutes).append("artifactChecksum", artifactChecksum) - .append("created", created).append("vnfResourceWorkflow", vnfResourceWorkflow) - .append("WorkflowActivitySpecSequence",workflowActivitySpecSequence).toString(); - } - @Override - public boolean equals(final Object other) { - if (!(other instanceof Workflow)) { - return false; - } - Workflow castOther = (Workflow) other; - return new EqualsBuilder().append(ID, castOther.ID).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(ID).toHashCode(); - } + private static final long serialVersionUID = 1485794141983033264L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer ID; + + @Column(name = "ARTIFACT_UUID") + private String artifactUUID; + + @Column(name = "ARTIFACT_NAME") + private String artifactName; + + @Column(name = "NAME") + private String name; + + @Column(name = "OPERATION_NAME") + private String operationName; + + @Column(name = "VERSION") + private Double version; + + @Column(name = "DESCRIPTION") + private String description; + + @Lob + @Column(name = "BODY", columnDefinition = "LONGTEXT") + private String body = null; + + @Column(name = "RESOURCE_TARGET") + private String resourceTarget; + + @Column(name = "SOURCE") + private String source; + + @Column(name = "TIMEOUT_MINUTES") + private Integer timeoutMinutes; + + @Column(name = "ARTIFACT_CHECKSUM") + private String artifactChecksum; + + @Column(name = "CREATION_TIMESTAMP", updatable = false) + @Temporal(TemporalType.TIMESTAMP) + private Date created; + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "workflow") + private List<VnfResourceWorkflow> vnfResourceWorkflow; + + @OneToMany(fetch = FetchType.LAZY, mappedBy = "workflow") + private List<WorkflowActivitySpecSequence> workflowActivitySpecSequence; + + @PrePersist + protected void onCreate() { + this.created = new Date(); + } + + public Integer getID() { + return ID; + } + + public String getArtifactUUID() { + return artifactUUID; + } + + public void setArtifactUUID(String artifactUUID) { + this.artifactUUID = artifactUUID; + } + + public String getArtifactName() { + return artifactName; + } + + public void setArtifactName(String artifactName) { + this.artifactName = artifactName; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getOperationName() { + return operationName; + } + + public void setOperationName(String operationName) { + this.operationName = operationName; + } + + public Double getVersion() { + return version; + } + + public void setVersion(Double version) { + this.version = version; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public String getResourceTarget() { + return resourceTarget; + } + + public void setResourceTarget(String resourceTarget) { + this.resourceTarget = resourceTarget; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public Integer getTimeoutMinutes() { + return timeoutMinutes; + } + + public void setTimeoutMinutes(Integer timeoutMinutes) { + this.timeoutMinutes = timeoutMinutes; + } + + public String getArtifactChecksum() { + return artifactChecksum; + } + + public void setArtifactChecksum(String artifactChecksum) { + this.artifactChecksum = artifactChecksum; + } + + public Date getCreated() { + return created; + } + + public void setCreated(Date created) { + this.created = created; + } + + @LinkedResource + public List<VnfResourceWorkflow> getVnfResourceWorkflow() { + return vnfResourceWorkflow; + } + + public void setVnfResourceWorkflow(List<VnfResourceWorkflow> vnfResourceWorkflow) { + this.vnfResourceWorkflow = vnfResourceWorkflow; + } + + @LinkedResource + public List<WorkflowActivitySpecSequence> getWorkflowActivitySpecSequence() { + return workflowActivitySpecSequence; + } + + public void setWorkflowActivitySpecSequence(List<WorkflowActivitySpecSequence> workflowActivitySpecSequence) { + this.workflowActivitySpecSequence = workflowActivitySpecSequence; + } + + @Override + public String toString() { + return new ToStringBuilder(this).append("ID", ID).append("artifactUUID", artifactUUID) + .append("artifactName", artifactName).append("name", name).append("operationName", operationName) + .append("version", version).append("description", description).append("body", body) + .append("resourceTarget", resourceTarget).append("source", source) + .append("timeoutMinutes", timeoutMinutes).append("artifactChecksum", artifactChecksum) + .append("created", created).append("vnfResourceWorkflow", vnfResourceWorkflow) + .append("WorkflowActivitySpecSequence", workflowActivitySpecSequence).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof Workflow)) { + return false; + } + Workflow castOther = (Workflow) other; + return new EqualsBuilder().append(ID, castOther.ID).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(ID).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequence.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequence.java index 8a1881edf3..4b497cc7da 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequence.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequence.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; import java.util.Date; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -37,13 +36,10 @@ 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 com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @@ -51,87 +47,86 @@ import uk.co.blackpepper.bowman.annotation.LinkedResource; @Table(name = "workflow_activity_spec_sequence") public class WorkflowActivitySpecSequence implements Serializable { - private static final long serialVersionUID = -8788505759463286871L; - - @Id - @Column(name = "ID", nullable = false, updatable = false) - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer ID; - - @BusinessKey - @Id - @Column(name = "ACTIVITY_SPEC_ID") - private Integer activitySpecId; - - @BusinessKey - @Id - @Column(name = "WORKFLOW_ID") - private Integer workflowId; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false) - private ActivitySpec activitySpec; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "WORKFLOW_ID", updatable = false, insertable = false) - private Workflow workflow; - - @Override - public String toString() { - return new ToStringBuilder(this).append("workflowId", workflowId) - .append("activitySpecId", activitySpecId) - .toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof WorkflowActivitySpecSequence)) { - return false; - } - WorkflowActivitySpecSequence castOther = (WorkflowActivitySpecSequence) other; - return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) - .append(workflowId, castOther.workflowId).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(activitySpecId).append(workflowId).toHashCode(); - } - - public Integer getID() { - return ID; - } - - public Integer getActivitySpecId() { - return activitySpecId; - } - - public void setActivitySpecId(Integer activitySpecId) { - this.activitySpecId = activitySpecId; - } - - public Integer getWorkflowId() { - return workflowId; - } - - public void setWorkflowId(Integer workflowId) { - this.workflowId = workflowId; - } - - public ActivitySpec getActivitySpec() { - return activitySpec; - } - - public void setActivitySpec(ActivitySpec activitySpec) { - this.activitySpec = activitySpec; - } - - public Workflow getWorkflow() { - return workflow; - } - - public void setWorkflow(Workflow workflow) { - this.workflow = workflow; - } - + private static final long serialVersionUID = -8788505759463286871L; + + @Id + @Column(name = "ID", nullable = false, updatable = false) + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer ID; + + @BusinessKey + @Id + @Column(name = "ACTIVITY_SPEC_ID") + private Integer activitySpecId; + + @BusinessKey + @Id + @Column(name = "WORKFLOW_ID") + private Integer workflowId; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "ACTIVITY_SPEC_ID", updatable = false, insertable = false) + private ActivitySpec activitySpec; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "WORKFLOW_ID", updatable = false, insertable = false) + private Workflow workflow; + + @Override + public String toString() { + return new ToStringBuilder(this).append("workflowId", workflowId).append("activitySpecId", activitySpecId) + .toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof WorkflowActivitySpecSequence)) { + return false; + } + WorkflowActivitySpecSequence castOther = (WorkflowActivitySpecSequence) other; + return new EqualsBuilder().append(activitySpecId, castOther.activitySpecId) + .append(workflowId, castOther.workflowId).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(activitySpecId).append(workflowId).toHashCode(); + } + + public Integer getID() { + return ID; + } + + public Integer getActivitySpecId() { + return activitySpecId; + } + + public void setActivitySpecId(Integer activitySpecId) { + this.activitySpecId = activitySpecId; + } + + public Integer getWorkflowId() { + return workflowId; + } + + public void setWorkflowId(Integer workflowId) { + this.workflowId = workflowId; + } + + public ActivitySpec getActivitySpec() { + return activitySpec; + } + + public void setActivitySpec(ActivitySpec activitySpec) { + this.activitySpec = activitySpec; + } + + public Workflow getWorkflow() { + return workflow; + } + + public void setWorkflow(Workflow workflow) { + this.workflow = workflow; + } + } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequenceId.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequenceId.java index f0a5759c3a..41af2ed3a5 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequenceId.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/WorkflowActivitySpecSequenceId.java @@ -21,62 +21,64 @@ package org.onap.so.db.catalog.beans; import java.io.Serializable; - 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; public class WorkflowActivitySpecSequenceId implements Serializable { - - private static final long serialVersionUID = -8987314754011453123L; - - private Integer ID; - @BusinessKey - private Integer workflowId; - @BusinessKey - private Integer activitySpecId; - - public Integer getID() { - return ID; - } - public void setID(Integer ID) { - this.ID = ID; - } - - public Integer getWorkflowId() { - return workflowId; - } - public void setWorkflowId(Integer workflowId) { - this.workflowId = workflowId; - } - public Integer getActivitySpecId() { - return activitySpecId; - } - public void setActivitySpecId(Integer activitySpecId) { - this.activitySpecId = activitySpecId; - } + private static final long serialVersionUID = -8987314754011453123L; + + private Integer ID; + + @BusinessKey + private Integer workflowId; + @BusinessKey + private Integer activitySpecId; + + public Integer getID() { + return ID; + } + + public void setID(Integer ID) { + this.ID = ID; + } + + public Integer getWorkflowId() { + return workflowId; + } + + public void setWorkflowId(Integer workflowId) { + this.workflowId = workflowId; + } + + public Integer getActivitySpecId() { + return activitySpecId; + } + + public void setActivitySpecId(Integer activitySpecId) { + this.activitySpecId = activitySpecId; + } - @Override - public String toString() { - return new ToStringBuilder(this).append("workflowId", workflowId) - .append("activitySpecId", activitySpecId).toString(); - } + @Override + public String toString() { + return new ToStringBuilder(this).append("workflowId", workflowId).append("activitySpecId", activitySpecId) + .toString(); + } - @Override - public boolean equals(final Object other) { - if (!(other instanceof WorkflowActivitySpecSequenceId)) { - return false; - } - WorkflowActivitySpecSequenceId castOther = (WorkflowActivitySpecSequenceId) other; - return new EqualsBuilder().append(workflowId, castOther.workflowId) - .append(activitySpecId, castOther.activitySpecId).isEquals(); - } + @Override + public boolean equals(final Object other) { + if (!(other instanceof WorkflowActivitySpecSequenceId)) { + return false; + } + WorkflowActivitySpecSequenceId castOther = (WorkflowActivitySpecSequenceId) other; + return new EqualsBuilder().append(workflowId, castOther.workflowId) + .append(activitySpecId, castOther.activitySpecId).isEquals(); + } - @Override - public int hashCode() { - return new HashCodeBuilder().append(workflowId).append(activitySpecId).toHashCode(); - } + @Override + public int hashCode() { + return new HashCodeBuilder().append(workflowId).append(activitySpecId).toHashCode(); + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java index 4025e348f8..6319ae01eb 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/NorthBoundRequest.java @@ -22,7 +22,6 @@ package org.onap.so.db.catalog.beans.macro; import java.io.Serializable; import java.util.List; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -32,181 +31,177 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToMany; 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 = "northbound_request_ref_lookup") public class NorthBoundRequest implements Serializable { - /** - * - */ - private static final long serialVersionUID = -2238991039015148725L; - - @Id - @Column(name = "id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @BusinessKey - @Column(name = "MACRO_ACTION") - private String macroAction; - - @BusinessKey - @Column(name = "ACTION") - private String action; - - @BusinessKey - @Column(name = "REQUEST_SCOPE") - private String requestScope; - - @BusinessKey - @Column(name = "IS_ALACARTE") - private Boolean isAlacarte; - - @BusinessKey - @Column(name = "IS_TOPLEVELFLOW") - private Boolean isToplevelflow; - - @BusinessKey - @Column(name = "MIN_API_VERSION") - private Double minApiVersion; - - @BusinessKey - @Column(name = "MAX_API_VERSION") - private Double maxApiVersion; - - @BusinessKey - @Column(name = "CLOUD_OWNER") - private String cloudOwner; - - @BusinessKey - @Column(name = "SERVICE_TYPE") - private String serviceType; - - @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "northBoundRequest") - private List<OrchestrationFlow> orchestrationFlowList; - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("action", action).append("requestScope", requestScope) - .append("isAlacarte", isAlacarte).append("isToplevelflow", isToplevelflow) - .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion) - .append("cloudOwner",cloudOwner).append("serviceType",serviceType).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof NorthBoundRequest)) { - return false; - } - NorthBoundRequest castOther = (NorthBoundRequest) other; - return new EqualsBuilder().append(action, castOther.action).append(requestScope, castOther.requestScope) - .append(isAlacarte, castOther.isAlacarte).append(isToplevelflow, castOther.isToplevelflow) - .append(minApiVersion, castOther.minApiVersion).append(maxApiVersion, castOther.maxApiVersion) - .append(cloudOwner, castOther.cloudOwner).append(serviceType, castOther.serviceType) - .isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(action).append(requestScope).append(isAlacarte).append(isToplevelflow) - .append(minApiVersion).append(maxApiVersion).append(cloudOwner).append(serviceType).toHashCode(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public String getMacroAction() { - return macroAction; - } - - public void setMacroAction(String macroAction) { - this.macroAction = macroAction; - } - - public String getRequestScope() { - return requestScope; - } - - public void setRequestScope(String requestScope) { - this.requestScope = requestScope; - } - - public Boolean getIsAlacarte() { - return isAlacarte; - } - - public void setIsAlacarte(Boolean isAlacarte) { - this.isAlacarte = isAlacarte; - } - - public Boolean getIsToplevelflow() { - return isToplevelflow; - } - - public void setIsToplevelflow(Boolean isToplevelflow) { - this.isToplevelflow = isToplevelflow; - } - - public Double getMinApiVersion() { - return minApiVersion; - } - - public void setMinApiVersion(Double minApiVersion) { - this.minApiVersion = minApiVersion; - } - - public Double getMaxApiVersion() { - return maxApiVersion; - } - - public void setMaxApiVersion(Double maxApiVersion) { - this.maxApiVersion = maxApiVersion; - } - - public String getCloudOwner() { - return cloudOwner; - } - - public void setCloudOwner(String cloudOwner) { - this.cloudOwner = cloudOwner; - } - - public String getServiceType() { - return serviceType; - } - - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - @LinkedResource - public List<OrchestrationFlow> getOrchestrationFlowList() { - return orchestrationFlowList; - } - - public void setOrchestrationFlowList(List<OrchestrationFlow> orchestrationFlowList) { - this.orchestrationFlowList = orchestrationFlowList; - } + /** + * + */ + private static final long serialVersionUID = -2238991039015148725L; + + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @BusinessKey + @Column(name = "MACRO_ACTION") + private String macroAction; + + @BusinessKey + @Column(name = "ACTION") + private String action; + + @BusinessKey + @Column(name = "REQUEST_SCOPE") + private String requestScope; + + @BusinessKey + @Column(name = "IS_ALACARTE") + private Boolean isAlacarte; + + @BusinessKey + @Column(name = "IS_TOPLEVELFLOW") + private Boolean isToplevelflow; + + @BusinessKey + @Column(name = "MIN_API_VERSION") + private Double minApiVersion; + + @BusinessKey + @Column(name = "MAX_API_VERSION") + private Double maxApiVersion; + + @BusinessKey + @Column(name = "CLOUD_OWNER") + private String cloudOwner; + + @BusinessKey + @Column(name = "SERVICE_TYPE") + private String serviceType; + + @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "northBoundRequest") + private List<OrchestrationFlow> orchestrationFlowList; + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("action", action).append("requestScope", requestScope) + .append("isAlacarte", isAlacarte).append("isToplevelflow", isToplevelflow) + .append("minApiVersion", minApiVersion).append("maxApiVersion", maxApiVersion) + .append("cloudOwner", cloudOwner).append("serviceType", serviceType).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof NorthBoundRequest)) { + return false; + } + NorthBoundRequest castOther = (NorthBoundRequest) other; + return new EqualsBuilder().append(action, castOther.action).append(requestScope, castOther.requestScope) + .append(isAlacarte, castOther.isAlacarte).append(isToplevelflow, castOther.isToplevelflow) + .append(minApiVersion, castOther.minApiVersion).append(maxApiVersion, castOther.maxApiVersion) + .append(cloudOwner, castOther.cloudOwner).append(serviceType, castOther.serviceType).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(action).append(requestScope).append(isAlacarte).append(isToplevelflow) + .append(minApiVersion).append(maxApiVersion).append(cloudOwner).append(serviceType).toHashCode(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public String getMacroAction() { + return macroAction; + } + + public void setMacroAction(String macroAction) { + this.macroAction = macroAction; + } + + public String getRequestScope() { + return requestScope; + } + + public void setRequestScope(String requestScope) { + this.requestScope = requestScope; + } + + public Boolean getIsAlacarte() { + return isAlacarte; + } + + public void setIsAlacarte(Boolean isAlacarte) { + this.isAlacarte = isAlacarte; + } + + public Boolean getIsToplevelflow() { + return isToplevelflow; + } + + public void setIsToplevelflow(Boolean isToplevelflow) { + this.isToplevelflow = isToplevelflow; + } + + public Double getMinApiVersion() { + return minApiVersion; + } + + public void setMinApiVersion(Double minApiVersion) { + this.minApiVersion = minApiVersion; + } + + public Double getMaxApiVersion() { + return maxApiVersion; + } + + public void setMaxApiVersion(Double maxApiVersion) { + this.maxApiVersion = maxApiVersion; + } + + public String getCloudOwner() { + return cloudOwner; + } + + public void setCloudOwner(String cloudOwner) { + this.cloudOwner = cloudOwner; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + @LinkedResource + public List<OrchestrationFlow> getOrchestrationFlowList() { + return orchestrationFlowList; + } + + public void setOrchestrationFlowList(List<OrchestrationFlow> orchestrationFlowList) { + this.orchestrationFlowList = orchestrationFlowList; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java index fc017c63aa..b74ade1e1f 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/OrchestrationFlow.java @@ -21,7 +21,6 @@ package org.onap.so.db.catalog.beans.macro; import java.io.Serializable; - import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -32,116 +31,113 @@ 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 org.onap.so.db.catalog.beans.BuildingBlockDetail; - import com.openpojo.business.annotation.BusinessKey; - import uk.co.blackpepper.bowman.annotation.LinkedResource; @Entity @Table(name = "orchestration_flow_reference") public class OrchestrationFlow implements Serializable { - private static final long serialVersionUID = 2457818854397870011L; - - @Id - @Column(name = "ID") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @BusinessKey - @Column(name = "COMPOSITE_ACTION") - private String action; - - @BusinessKey - @Column(name = "SEQ_NO") - private Integer sequenceNumber; - - @BusinessKey - @Column(name = "FLOW_NAME") - private String flowName; - - @BusinessKey - @Column(name = "FLOW_VERSION") - private Double flowVersion; - - @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - @JoinColumn(name = "NB_REQ_REF_LOOKUP_ID") - private NorthBoundRequest northBoundRequest; - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("action", action) - .append("sequenceNumber", sequenceNumber).append("flowName", flowName) - .append("flowVersion", flowVersion).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof OrchestrationFlow)) { - return false; - } - OrchestrationFlow castOther = (OrchestrationFlow) other; - return new EqualsBuilder().append(action, castOther.action).append(sequenceNumber, castOther.sequenceNumber) - .append(flowName, castOther.flowName).append(flowVersion, castOther.flowVersion).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(action).append(sequenceNumber).append(flowName).append(flowVersion) - .toHashCode(); - } - - public String getAction() { - return action; - } - - public void setAction(String action) { - this.action = action; - } - - public Integer getSequenceNumber() { - return sequenceNumber; - } - - public void setSequenceNumber(Integer sequenceNumber) { - this.sequenceNumber = sequenceNumber; - } - - public String getFlowName() { - return flowName; - } - - public void setFlowName(String flowName) { - this.flowName = flowName; - } - - public Double getFlowVersion() { - return flowVersion; - } - - public void setFlowVersion(Double flowVersion) { - this.flowVersion = flowVersion; - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - @LinkedResource - public NorthBoundRequest getNorthBoundRequest() { - return northBoundRequest; - } - - public void setNorthBoundRequest(NorthBoundRequest northBoundRequest) { - this.northBoundRequest = northBoundRequest; - } + private static final long serialVersionUID = 2457818854397870011L; + + @Id + @Column(name = "ID") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @BusinessKey + @Column(name = "COMPOSITE_ACTION") + private String action; + + @BusinessKey + @Column(name = "SEQ_NO") + private Integer sequenceNumber; + + @BusinessKey + @Column(name = "FLOW_NAME") + private String flowName; + + @BusinessKey + @Column(name = "FLOW_VERSION") + private Double flowVersion; + + @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY) + @JoinColumn(name = "NB_REQ_REF_LOOKUP_ID") + private NorthBoundRequest northBoundRequest; + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("action", action) + .append("sequenceNumber", sequenceNumber).append("flowName", flowName) + .append("flowVersion", flowVersion).toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof OrchestrationFlow)) { + return false; + } + OrchestrationFlow castOther = (OrchestrationFlow) other; + return new EqualsBuilder().append(action, castOther.action).append(sequenceNumber, castOther.sequenceNumber) + .append(flowName, castOther.flowName).append(flowVersion, castOther.flowVersion).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(action).append(sequenceNumber).append(flowName).append(flowVersion) + .toHashCode(); + } + + public String getAction() { + return action; + } + + public void setAction(String action) { + this.action = action; + } + + public Integer getSequenceNumber() { + return sequenceNumber; + } + + public void setSequenceNumber(Integer sequenceNumber) { + this.sequenceNumber = sequenceNumber; + } + + public String getFlowName() { + return flowName; + } + + public void setFlowName(String flowName) { + this.flowName = flowName; + } + + public Double getFlowVersion() { + return flowVersion; + } + + public void setFlowVersion(Double flowVersion) { + this.flowVersion = flowVersion; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + @LinkedResource + public NorthBoundRequest getNorthBoundRequest() { + return northBoundRequest; + } + + public void setNorthBoundRequest(NorthBoundRequest northBoundRequest) { + this.northBoundRequest = northBoundRequest; + } } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/RainyDayHandlerStatus.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/RainyDayHandlerStatus.java index 23d9d7bc6c..a12edac8a0 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/RainyDayHandlerStatus.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/beans/macro/RainyDayHandlerStatus.java @@ -21,146 +21,144 @@ package org.onap.so.db.catalog.beans.macro; import java.io.Serializable; - import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; 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; @Entity @Table(name = "rainy_day_handler_macro") public class RainyDayHandlerStatus implements Serializable { - /** - * - */ - private static final long serialVersionUID = 1L; - - @Id - @Column(name = "id") - @GeneratedValue(strategy = GenerationType.IDENTITY) - private Integer id; - - @BusinessKey - @Column(name = "FLOW_NAME") - private String flowName; - - @BusinessKey - @Column(name = "SERVICE_TYPE") - private String serviceType; - - @BusinessKey - @Column(name = "VNF_TYPE") - private String vnfType; - - @BusinessKey - @Column(name = "ERROR_CODE") - private String errorCode; - - @BusinessKey - @Column(name = "WORK_STEP") - private String workStep; - - @BusinessKey - @Column(name = "POLICY") - private String policy; - - @Column(name = "SECONDARY_POLICY") - private String secondaryPolicy; - - @Override - public String toString() { - return new ToStringBuilder(this).append("id", id).append("flowName", flowName) - .append("serviceType", serviceType).append("vnfType", vnfType).append("errorCode", errorCode) - .append("workStep", workStep).append("policy", policy).append("secondaryPolicy",secondaryPolicy).toString(); - } - - @Override - public boolean equals(final Object other) { - if (!(other instanceof RainyDayHandlerStatus)) { - return false; - } - RainyDayHandlerStatus castOther = (RainyDayHandlerStatus) other; - return new EqualsBuilder().append(flowName, castOther.flowName).append(serviceType, castOther.serviceType) - .append(vnfType, castOther.vnfType).append(errorCode, castOther.errorCode) - .append(workStep, castOther.workStep).append(policy, castOther.policy).isEquals(); - } - - @Override - public int hashCode() { - return new HashCodeBuilder().append(flowName).append(serviceType).append(vnfType).append(errorCode) - .append(workStep).append(policy).toHashCode(); - } - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getFlowName() { - return flowName; - } - - public void setFlowName(String flowName) { - this.flowName = flowName; - } - - public String getServiceType() { - return serviceType; - } - - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - public String getVnfType() { - return vnfType; - } - - public void setVnfType(String vnfType) { - this.vnfType = vnfType; - } - - public String getErrorCode() { - return errorCode; - } - - public void setErrorCode(String errorCode) { - this.errorCode = errorCode; - } - - public String getWorkStep() { - return workStep; - } - - public void setWorkStep(String workStep) { - this.workStep = workStep; - } - - public String getPolicy() { - return policy; - } - - public void setPolicy(String policy) { - this.policy = policy; - } - - public String getSecondaryPolicy() { - return secondaryPolicy; - } - - public void setSecondaryPolicy(String secondaryPolicy) { - this.secondaryPolicy = secondaryPolicy; - } + /** + * + */ + private static final long serialVersionUID = 1L; + + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + private Integer id; + + @BusinessKey + @Column(name = "FLOW_NAME") + private String flowName; + + @BusinessKey + @Column(name = "SERVICE_TYPE") + private String serviceType; + + @BusinessKey + @Column(name = "VNF_TYPE") + private String vnfType; + + @BusinessKey + @Column(name = "ERROR_CODE") + private String errorCode; + + @BusinessKey + @Column(name = "WORK_STEP") + private String workStep; + + @BusinessKey + @Column(name = "POLICY") + private String policy; + + @Column(name = "SECONDARY_POLICY") + private String secondaryPolicy; + + @Override + public String toString() { + return new ToStringBuilder(this).append("id", id).append("flowName", flowName) + .append("serviceType", serviceType).append("vnfType", vnfType).append("errorCode", errorCode) + .append("workStep", workStep).append("policy", policy).append("secondaryPolicy", secondaryPolicy) + .toString(); + } + + @Override + public boolean equals(final Object other) { + if (!(other instanceof RainyDayHandlerStatus)) { + return false; + } + RainyDayHandlerStatus castOther = (RainyDayHandlerStatus) other; + return new EqualsBuilder().append(flowName, castOther.flowName).append(serviceType, castOther.serviceType) + .append(vnfType, castOther.vnfType).append(errorCode, castOther.errorCode) + .append(workStep, castOther.workStep).append(policy, castOther.policy).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder().append(flowName).append(serviceType).append(vnfType).append(errorCode) + .append(workStep).append(policy).toHashCode(); + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getFlowName() { + return flowName; + } + + public void setFlowName(String flowName) { + this.flowName = flowName; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getErrorCode() { + return errorCode; + } + + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + } + + public String getWorkStep() { + return workStep; + } + + public void setWorkStep(String workStep) { + this.workStep = workStep; + } + + public String getPolicy() { + return policy; + } + + public void setPolicy(String policy) { + this.policy = policy; + } + + public String getSecondaryPolicy() { + return secondaryPolicy; + } + + public void setSecondaryPolicy(String secondaryPolicy) { + this.secondaryPolicy = secondaryPolicy; + } } |