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;
32 * Every entity class must have a default constructor according to
33 * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
34 * Definition of mapped classes</a>.
36 public ComponentDependencyModelEntity() {
37 // Don't delete! Default constructor is required by DataStax driver
41 * Instantiates a new ComponentDependencyModelEntity entity.
43 * @param vspId the vsp id
44 * @param version the version
45 * @param dependencyId the dependencyId
47 public ComponentDependencyModelEntity(String vspId, Version version, String dependencyId) {
49 this.version = version;
50 this.id = dependencyId;
54 public String getEntityType() {
59 public String getFirstClassCitizenId() {
64 public String getId() {
69 public void setId(String id) {
74 public Version getVersion() {
79 public void setVersion(Version version) {
80 this.version = version;
83 public String getVspId() {
87 public void setVspId(String vspId) {
91 public String getTargetComponentId() {
92 return targetComponentId;
95 public void setTargetComponentId(String targetComponentId) {
96 this.targetComponentId = targetComponentId;
99 public String getSourceComponentId() {
100 return sourceComponentId;
103 public void setSourceComponentId(String sourceComponentId) {
104 this.sourceComponentId = sourceComponentId;
107 public String getRelation() {
111 public void setRelation(String relation) {
112 this.relation = relation;
116 public boolean equals(Object o) {
120 if (o == null || getClass() != o.getClass()) {
124 ComponentDependencyModelEntity that = (ComponentDependencyModelEntity) o;
126 if (vspId != null ? !vspId.equals(that.vspId) : that.vspId != null) {
129 if (version != null ? !version.equals(that.version) : that.version != null) {
132 if (id != null ? !id.equals(that.id) : that.id != null) {
135 if (sourceComponentId != null ? !sourceComponentId.equals(that.sourceComponentId)
136 : that.sourceComponentId != null) {
139 if (targetComponentId != null ? !targetComponentId.equals(that.targetComponentId)
140 : that.targetComponentId != null) {
143 if (relation != null ? !relation.equals(that.relation) : that.relation != null) {
151 public int hashCode() {
152 int result = vspId != null ? vspId.hashCode() : 0;
153 result = 31 * result + (version != null ? version.hashCode() : 0);
154 result = 31 * result + (id != null ? id.hashCode() : 0);
155 result = 31 * result + (sourceComponentId != null ? sourceComponentId.hashCode() : 0);
156 result = 31 * result + (targetComponentId != null ? targetComponentId.hashCode() : 0);
157 result = 31 * result + (relation != null ? relation.hashCode() : 0);