936d7198c8aef1527f0504c81c37e60e50f78b87
[sdc.git] /
1 /*
2 * Copyright © 2016-2018 European Support Limited
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.openecomp.core.tools.store.zusammen.datatypes;
18
19 import com.datastax.driver.mapping.annotations.ClusteringColumn;
20 import com.datastax.driver.mapping.annotations.Column;
21 import com.datastax.driver.mapping.annotations.PartitionKey;
22 import com.datastax.driver.mapping.annotations.Table;
23
24 import java.util.Map;
25
26 /**
27  * CREATE TABLE zusammen_dox.version_elements (
28  * space text,
29  * item_id text,
30  * version_id text,
31  * revision_id text,
32  * conflict_element_ids set<text>,
33  * dirty_element_ids set<text>,
34  * element_ids map<text, text>,
35  * message text,
36  * publish_time timestamp,
37  * stage_element_ids set<text>,
38  * user text,
39  * PRIMARY KEY ((space, item_id, version_id), revision_id))
40  * WITH CLUSTERING ORDER BY (revision_id ASC)
41  */
42
43 @Table(
44         keyspace = "zusammen_dox",
45         name = "version_elements"
46 )
47 public class VersionElementsEntity {
48     @Column( name = "space" )
49     @PartitionKey(0)
50     private String space;
51
52     @Column(   name = "item_id" )
53     @PartitionKey(1)
54     private String itemId;
55
56     @Column(  name = "version_id" )
57     @PartitionKey(2)
58     private String versionId;
59
60     @Column(name = "revision_id")
61     @ClusteringColumn
62     private String revisionId;
63
64     @Column(name = "element_ids")
65     private Map<String,String> elementIds;
66
67     public void setSpace(String space) {
68         this.space = space;
69     }
70     public String getSpace() {
71         return space;
72     }
73
74     public void setItemId(String itemId) {
75         this.itemId = itemId;
76     }
77     public String getItemId() {
78         return itemId;
79     }
80
81     public void setVersionId(String versionId) {
82         this.versionId = versionId;
83     }
84     public String getVersionId() {
85         return versionId;
86     }
87
88     public void setRevisionId(String revisionId) {
89         this.revisionId = revisionId;
90     }
91     public String getRevisionId() {
92         return revisionId;
93     }
94
95     public void setElementIds(Map<String,String> elementIds) {
96         this.elementIds = elementIds;
97     }
98     public Map<String,String> getElementIds() {
99         return elementIds;
100     }
101 }