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=========================================================
21 package org.openecomp.sdc.versioning.dao.types;
23 import com.datastax.driver.mapping.annotations.ClusteringColumn;
24 import com.datastax.driver.mapping.annotations.Column;
25 import com.datastax.driver.mapping.annotations.Frozen;
26 import com.datastax.driver.mapping.annotations.FrozenValue;
27 import com.datastax.driver.mapping.annotations.PartitionKey;
28 import com.datastax.driver.mapping.annotations.Table;
30 import java.util.HashSet;
33 @Table(keyspace = "dox", name = "version_info")
34 public class VersionInfoEntity {
37 @Column(name = "entity_type")
38 private String entityType;
41 @Column(name = "entity_id")
42 private String entityId;
44 @Column(name = "active_version")
46 private Version activeVersion;
48 private VersionStatus status;
51 private UserCandidateVersion candidate;
53 @Column(name = "viewable_versions")
55 private Set<Version> viewableVersions = new HashSet<>();
57 @Column(name = "latest_final_version")
59 private Version latestFinalVersion;
62 * Every entity class must have a default constructor according to
63 * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
64 * Definition of mapped classes</a>.
66 public VersionInfoEntity() {
67 // Don't delete! Default constructor is required by DataStax driver
70 public VersionInfoEntity(String entityType, String entityId) {
71 this.entityType = entityType;
72 this.entityId = entityId;
75 public String getEntityType() {
79 public void setEntityType(String entityType) {
80 this.entityType = entityType;
83 public String getEntityId() {
87 public void setEntityId(String entityId) {
88 this.entityId = entityId;
91 public Version getActiveVersion() {
95 public void setActiveVersion(Version activeVersion) {
96 this.activeVersion = activeVersion;
99 public VersionStatus getStatus() {
103 public void setStatus(VersionStatus status) {
104 this.status = status;
107 public UserCandidateVersion getCandidate() {
111 public void setCandidate(UserCandidateVersion candidate) {
112 this.candidate = candidate;
115 public Set<Version> getViewableVersions() {
116 return viewableVersions;
119 public void setViewableVersions(Set<Version> viewableVersions) {
120 this.viewableVersions = viewableVersions;
123 public Version getLatestFinalVersion() {
124 return latestFinalVersion;
127 public void setLatestFinalVersion(Version latestFinalVersion) {
128 this.latestFinalVersion = latestFinalVersion;