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.Enumerated;
26 import com.datastax.driver.mapping.annotations.Frozen;
27 import com.datastax.driver.mapping.annotations.FrozenValue;
28 import com.datastax.driver.mapping.annotations.PartitionKey;
29 import com.datastax.driver.mapping.annotations.Table;
31 import java.util.HashSet;
34 @Table(keyspace = "dox", name = "version_info")
35 public class VersionInfoEntity {
38 @Column(name = "entity_type")
39 private String entityType;
42 @Column(name = "entity_id")
43 private String entityId;
45 @Column(name = "active_version")
47 private Version activeVersion;
50 private VersionStatus status;
53 private UserCandidateVersion candidate;
55 @Column(name = "viewable_versions")
57 private Set<Version> viewableVersions = new HashSet<>();
59 @Column(name = "latest_final_version")
61 private Version latestFinalVersion;
63 public VersionInfoEntity() {
66 public VersionInfoEntity(String entityType, String entityId) {
67 this.entityType = entityType;
68 this.entityId = entityId;
71 public String getEntityType() {
75 public void setEntityType(String entityType) {
76 this.entityType = entityType;
79 public String getEntityId() {
83 public void setEntityId(String entityId) {
84 this.entityId = entityId;
87 public Version getActiveVersion() {
91 public void setActiveVersion(Version activeVersion) {
92 this.activeVersion = activeVersion;
95 public VersionStatus getStatus() {
99 public void setStatus(VersionStatus status) {
100 this.status = status;
103 public UserCandidateVersion getCandidate() {
107 public void setCandidate(UserCandidateVersion candidate) {
108 this.candidate = candidate;
111 public Set<Version> getViewableVersions() {
112 return viewableVersions;
115 public void setViewableVersions(Set<Version> viewableVersions) {
116 this.viewableVersions = viewableVersions;
119 public Version getLatestFinalVersion() {
120 return latestFinalVersion;
123 public void setLatestFinalVersion(Version latestFinalVersion) {
124 this.latestFinalVersion = latestFinalVersion;