2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
20 package org.openecomp.sdc.vendorlicense.dao.types;
22 import com.datastax.driver.mapping.annotations.Column;
23 import com.datastax.driver.mapping.annotations.Computed;
24 import com.datastax.driver.mapping.annotations.Frozen;
25 import com.datastax.driver.mapping.annotations.PartitionKey;
26 import com.datastax.driver.mapping.annotations.Table;
27 import java.util.Objects;
28 import org.openecomp.sdc.versioning.dao.types.Version;
29 import org.openecomp.sdc.versioning.dao.types.VersionableEntity;
31 @Table(keyspace = "dox", name = "vendor_license_model")
32 public class VendorLicenseModelEntity implements VersionableEntity {
34 public static final String ENTITY_TYPE = "Vendor License Model";
36 @Column(name = "vlm_id")
38 @PartitionKey(value = 1)
40 private Version version;
41 @Column(name = "vendor_name")
42 private String vendorName;
43 private String description;
44 private String oldVersion;
45 @Column(name = "icon")
46 private String iconRef;
47 @Computed("writetime(vendor_name)")
48 private Long writetimeMicroSeconds;
51 * Every entity class must have a default constructor according to
52 * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
53 * Definition of mapped classes</a>.
55 public VendorLicenseModelEntity() {
56 // Don't delete! Default constructor is required by DataStax driver
59 public VendorLicenseModelEntity(String id, Version version) {
61 this.version = version;
65 public String getEntityType() {
70 public String getFirstClassCitizenId() {
74 public String getId() {
78 public void setId(String id) {
83 public Version getVersion() {
88 public void setVersion(Version version) {
89 this.version = version;
92 public String getVendorName() {
96 public void setVendorName(String vendorName) {
97 this.vendorName = vendorName;
100 public String getDescription() {
104 public void setDescription(String description) {
105 this.description = description;
108 public String getIconRef() {
112 public void setIconRef(String iconRef) {
113 this.iconRef = iconRef;
116 public String getOldVersion() {
120 public void setOldVersion(String oldVersion) {
121 this.oldVersion = oldVersion;
125 public int hashCode() {
126 return Objects.hash(id, version, vendorName, description, iconRef);
130 public boolean equals(Object obj) {
134 if (obj == null || getClass() != obj.getClass()) {
137 VendorLicenseModelEntity that = (VendorLicenseModelEntity) obj;
138 return Objects.equals(id, that.id) && Objects.equals(version, that.version) && Objects.equals(vendorName, that.vendorName) && Objects
139 .equals(description, that.description) && Objects.equals(iconRef, that.iconRef);