12b82f7aedd8315684dde3361677ff5bc08cd8a1
[sdc.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.openecomp.sdc.versioning.dao.types;
22
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;
29 import lombok.Getter;
30 import lombok.NoArgsConstructor;
31 import lombok.Setter;
32
33 import java.util.HashSet;
34 import java.util.Set;
35
36 @Table(keyspace = "dox", name = "version_info_deleted")
37 @Getter
38 @Setter
39 @NoArgsConstructor
40 public class VersionInfoDeletedEntity {
41
42   @PartitionKey
43   @Column(name = "entity_type")
44   private String entityType;
45
46   @ClusteringColumn
47   @Column(name = "entity_id")
48   private String entityId;
49
50   @Column(name = "active_version")
51   @Frozen
52   private Version activeVersion;
53
54   private VersionStatus status;
55
56   @Frozen
57   private UserCandidateVersion candidate;
58
59   @Column(name = "viewable_versions")
60   @FrozenValue
61   private Set<Version> viewableVersions = new HashSet<>();
62
63   @Column(name = "latest_final_version")
64   @Frozen
65   private Version latestFinalVersion;
66
67   public VersionInfoDeletedEntity(String entityType, String entityId) {
68     this.entityType = entityType;
69     this.entityId = entityId;
70   }
71
72 }