9d1093babcbf18fb6c98d16ca4e4e29e8d6ed629
[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.Column;
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
28 @Table(keyspace = "dox", name = "version_history")
29 public class VersionHistoryEntity {
30
31   @PartitionKey
32   @Column(name = "entity_id")
33   @Frozen
34   private VersionableEntityId entityId;
35
36   @Column(name = "active_version")
37   @Frozen
38   private Version version;
39
40   private String user;
41   private String description;
42   private VersionType type;
43
44   /**
45    * Every entity class must have a default constructor according to
46    * <a href="http://docs.datastax.com/en/developer/java-driver/2.1/manual/object_mapper/creating/">
47    * Definition of mapped classes</a>.
48    */
49   public VersionHistoryEntity() {
50     // Don't delete! Default constructor is required by DataStax driver
51   }
52
53   public VersionHistoryEntity(VersionableEntityId entityId) {
54     this.entityId = entityId;
55   }
56
57   public VersionableEntityId getEntityId() {
58     return entityId;
59   }
60
61   public void setEntityId(VersionableEntityId entityId) {
62     this.entityId = entityId;
63   }
64
65   public Version getVersion() {
66     return version;
67   }
68
69   public void setVersion(Version version) {
70     this.version = version;
71   }
72
73   public String getUser() {
74     return user;
75   }
76
77   public void setUser(String user) {
78     this.user = user;
79   }
80
81   public String getDescription() {
82     return description;
83   }
84
85   public void setDescription(String description) {
86     this.description = description;
87   }
88
89   public VersionType getType() {
90     return type;
91   }
92
93   public void setType(VersionType type) {
94     this.type = type;
95   }
96 }