1 package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
 
   3 import com.datastax.driver.mapping.annotations.ClusteringColumn;
 
   4 import com.datastax.driver.mapping.annotations.Column;
 
   5 import com.datastax.driver.mapping.annotations.Frozen;
 
   6 import com.datastax.driver.mapping.annotations.PartitionKey;
 
   7 import com.datastax.driver.mapping.annotations.Table;
 
   8 import org.openecomp.sdc.versioning.dao.types.Version;
 
   9 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
 
  11 @Table(keyspace = "dox", name = "vsp_component_dependency_model")
 
  12 public class ComponentDependencyModelEntity implements VersionableEntity {
 
  14   public static final String ENTITY_TYPE = "Vendor Software Product Component Dependency Model";
 
  16   @Column(name = "vsp_id")
 
  18   @PartitionKey(value = 1)
 
  20   private Version version;
 
  22   @Column(name = "dependency_id")
 
  24   @Column(name = "sourcecomponent_id")
 
  25   private String sourceComponentId;
 
  26   @Column(name = "targetcomponent_id")
 
  27   private String targetComponentId;
 
  28   @Column(name = "relation")
 
  29   private String relation;
 
  31   public ComponentDependencyModelEntity() {
 
  36    * Instantiates a new ComponentDependencyModelEntity entity.
 
  38    * @param vspId   the vsp id
 
  39    * @param version the version
 
  40    * @param dependencyId      the dependencyId
 
  42   public ComponentDependencyModelEntity(String vspId, Version version, String dependencyId) {
 
  44     this.version = version;
 
  45     this.id = dependencyId;
 
  49   public String getEntityType() {
 
  54   public String getFirstClassCitizenId() {
 
  59   public String getId() {
 
  64   public void setId(String id) {
 
  69   public Version getVersion() {
 
  74   public void setVersion(Version version) {
 
  75     this.version = version;
 
  78   public String getVspId() {
 
  82   public void setVspId(String vspId) {
 
  86   public String getTargetComponentId() {
 
  87     return targetComponentId;
 
  90   public void setTargetComponentId(String targetComponentId) {
 
  91     this.targetComponentId = targetComponentId;
 
  94   public String getSourceComponentId() {
 
  95     return sourceComponentId;
 
  98   public void setSourceComponentId(String sourceComponentId) {
 
  99         this.sourceComponentId = sourceComponentId;
 
 102   public String getRelation() {
 
 106   public void setRelation(String relation) {
 
 107     this.relation = relation;
 
 111   public boolean equals(Object o) {
 
 115     if (o == null || getClass() != o.getClass()) {
 
 119     ComponentDependencyModelEntity that = (ComponentDependencyModelEntity) o;
 
 121     if (vspId != null ? !vspId.equals(that.vspId) : that.vspId != null) {
 
 124     if (version != null ? !version.equals(that.version) : that.version != null) {
 
 127     if (id != null ? !id.equals(that.id) : that.id != null) {
 
 130     if (sourceComponentId != null ? !sourceComponentId.equals(that.sourceComponentId)
 
 131         : that.sourceComponentId != null) {
 
 134     if (targetComponentId != null ? !targetComponentId.equals(that.targetComponentId)
 
 135         : that.targetComponentId != null) {
 
 138     if (relation != null ? !relation.equals(that.relation) : that.relation != null) {
 
 146   public int hashCode() {
 
 147     int result = vspId != null ? vspId.hashCode() : 0;
 
 148     result = 31 * result + (version != null ? version.hashCode() : 0);
 
 149     result = 31 * result + (id != null ? id.hashCode() : 0);
 
 150     result = 31 * result + (sourceComponentId != null ? sourceComponentId.hashCode() : 0);
 
 151     result = 31 * result + (targetComponentId != null ? targetComponentId.hashCode() : 0);
 
 152     result = 31 * result + (relation != null ? relation.hashCode() : 0);