1 package org.openecomp.sdc.vendorsoftwareproduct.dao.type;
3 import com.datastax.driver.mapping.annotations.*;
4 import org.openecomp.sdc.versioning.dao.types.Version;
5 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
7 @Table(keyspace = "dox", name = "vsp_component_dependency_model")
8 public class ComponentDependencyModelEntity implements VersionableEntity {
10 public static final String ENTITY_TYPE = "Vendor Software Product Component Dependency Model";
12 @Column(name = "vsp_id")
14 @PartitionKey(value = 1)
16 private Version version;
18 @Column(name = "dependency_id")
20 @Column(name = "sourcecomponent_id")
21 private String sourceComponentId;
22 @Column(name = "targetcomponent_id")
23 private String targetComponentId;
24 @Column(name = "relation")
25 private String relation;
28 * Every entity class must have a default constructor according to
29 * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
30 * Definition of mapped classes</a>.
32 public ComponentDependencyModelEntity() {
33 // Don't delete! Default constructor is required by DataStax driver
37 * Instantiates a new ComponentDependencyModelEntity entity.
39 * @param vspId the vsp id
40 * @param version the version
41 * @param dependencyId the dependencyId
43 public ComponentDependencyModelEntity(String vspId, Version version, String dependencyId) {
45 this.version = version;
46 this.id = dependencyId;
50 public String getEntityType() {
55 public String getFirstClassCitizenId() {
60 public String getId() {
65 public void setId(String id) {
70 public Version getVersion() {
75 public void setVersion(Version version) {
76 this.version = version;
79 public String getVspId() {
83 public void setVspId(String vspId) {
87 public String getTargetComponentId() {
88 return targetComponentId;
91 public void setTargetComponentId(String targetComponentId) {
92 this.targetComponentId = targetComponentId;
95 public String getSourceComponentId() {
96 return sourceComponentId;
99 public void setSourceComponentId(String sourceComponentId) {
100 this.sourceComponentId = sourceComponentId;
103 public String getRelation() {
107 public void setRelation(String relation) {
108 this.relation = relation;
112 public boolean equals(Object o) {
116 if (o == null || getClass() != o.getClass()) {
120 ComponentDependencyModelEntity that = (ComponentDependencyModelEntity) o;
122 if (vspId != null ? !vspId.equals(that.vspId) : that.vspId != null) {
125 if (version != null ? !version.equals(that.version) : that.version != null) {
128 if (id != null ? !id.equals(that.id) : that.id != null) {
131 if (sourceComponentId != null ? !sourceComponentId.equals(that.sourceComponentId)
132 : that.sourceComponentId != null) {
135 if (targetComponentId != null ? !targetComponentId.equals(that.targetComponentId)
136 : that.targetComponentId != null) {
139 if (relation != null ? !relation.equals(that.relation) : that.relation != null) {
147 public int hashCode() {
148 int result = vspId != null ? vspId.hashCode() : 0;
149 result = 31 * result + (version != null ? version.hashCode() : 0);
150 result = 31 * result + (id != null ? id.hashCode() : 0);
151 result = 31 * result + (sourceComponentId != null ? sourceComponentId.hashCode() : 0);
152 result = 31 * result + (targetComponentId != null ? targetComponentId.hashCode() : 0);
153 result = 31 * result + (relation != null ? relation.hashCode() : 0);