Added Junis for Policy ONAP-REST
[policy/engine.git] / ONAP-REST / src / main / java / org / onap / policy / rest / jpa / TermList.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP-REST
4  * ================================================================================
5  * Copyright (C) 2017-2018 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.onap.policy.rest.jpa;
22
23 import java.io.Serializable;
24 import java.util.Date;
25
26 import javax.persistence.Column;
27 import javax.persistence.Entity;
28 import javax.persistence.GeneratedValue;
29 import javax.persistence.GenerationType;
30 import javax.persistence.Id;
31 import javax.persistence.JoinColumn;
32 import javax.persistence.ManyToOne;
33 import javax.persistence.NamedQuery;
34 import javax.persistence.OrderBy;
35 import javax.persistence.PrePersist;
36 import javax.persistence.PreUpdate;
37 import javax.persistence.Table;
38 import javax.persistence.Temporal;
39 import javax.persistence.TemporalType;
40
41
42 @Entity
43 @Table(name="TERM")
44 @NamedQuery(name="TermList.findAll", query="SELECT e FROM TermList e")
45 public class TermList implements Serializable {
46         private static final long serialVersionUID = 1L;
47
48         @Id
49         @GeneratedValue(strategy = GenerationType.AUTO)
50         @Column(name="id")
51         private int id;
52         
53         @Column(name="termName", nullable=false)
54         @OrderBy("asc")
55         private String termName;
56         
57         @Column(name="description")
58         private String termDescription;
59         
60         @Column(name="fromzone")
61         private String fromZone;
62         
63         @Column(name="tozone")
64         private String toZone;
65         
66         @Column(name="srcIPList")
67         private String srcIPList;
68         
69         @Column(name="destIPList")
70         private String destIPList;
71         
72         @Column(name="protocolList")
73         private String protocolList;
74         
75         @Column(name="portList")
76         private String portList;
77         
78         @Column(name="srcPortList")
79         private String srcPortList;
80         
81         @Column(name="destPortList")
82         private String destPortList;
83         
84         @Column(name="action")
85         private String action;
86
87         @Temporal(TemporalType.TIMESTAMP)
88         @Column(name="created_date", updatable=false)
89         private Date createdDate;
90
91         @Temporal(TemporalType.TIMESTAMP)
92         @Column(name="modified_date", nullable=false)
93         private Date modifiedDate;
94         
95         @ManyToOne(optional = false)
96         @JoinColumn(name="created_by")
97         private UserInfo userCreatedBy;
98
99         @ManyToOne(optional = false)
100         @JoinColumn(name="modified_by")
101         private UserInfo userModifiedBy;
102         
103         public Date getCreatedDate() {
104                 return this.createdDate;
105         }
106         public void setCreatedDate(Date createdDate) {
107                 this.createdDate = createdDate;
108         }
109         
110         public Date getModifiedDate() {
111                 return this.modifiedDate;
112         }
113         public void setModifiedDate(Date modifiedDate) {
114                 this.modifiedDate = modifiedDate;
115         }
116         
117         public UserInfo getUserCreatedBy() {
118                 return userCreatedBy;
119         }
120
121         public void setUserCreatedBy(UserInfo userCreatedBy) {
122                 this.userCreatedBy = userCreatedBy;
123         }
124
125         public UserInfo getUserModifiedBy() {
126                 return userModifiedBy;
127         }
128
129         public void setUserModifiedBy(UserInfo userModifiedBy) {
130                 this.userModifiedBy = userModifiedBy;
131         }
132
133         @PrePersist
134         public void     prePersist() {
135                 Date date = new Date();
136                 this.createdDate = date;
137                 this.modifiedDate = date;
138         }
139         
140         @PreUpdate
141         public void preUpdate() {
142                 this.modifiedDate = new Date();
143         }
144         
145         public int getId() {
146                 return this.id;
147         }
148
149         public void setId(int id) {
150                 this.id = id;
151         }
152         
153         public String getTermName() {
154                 return this.termName;
155         }
156
157         public void setTermName(String termName) {
158                 this.termName = termName;
159         }
160         
161         public String getTermDescription() {
162                 return this.termDescription;
163         }
164
165         public void setDescription(String termDescription) {
166                 this.termDescription = termDescription;
167         }
168         
169         public String getFromZone() {
170                 return this.fromZone;
171         }
172
173         public void setFromZones(String fromZone) {
174                 this.fromZone = fromZone;
175         }
176         
177         public String getToZone() {
178                 return this.toZone;
179         }
180
181         public void setToZones(String toZone) {
182                 this.toZone = toZone;
183         }
184         
185         public String getSrcIPList() {
186                 return this.srcIPList;
187         }
188
189         public void setSrcIPList(String srcIPList) {
190                 this.srcIPList = srcIPList;
191         }
192         
193         public String getDestIPList() {
194                 return this.destIPList;
195         }
196
197         public void setDestIPList(String destIPList) {
198                 this.destIPList = destIPList;
199         }
200         
201         public String getProtocolList() {
202                 return this.protocolList;
203         }
204
205         public void setProtocolList(String protocolList) {
206                 this.protocolList = protocolList;
207         }
208         
209         public String getPortList() {
210                 return this.portList;
211         }
212
213         public void setPortList(String portList) {
214                 this.portList = portList;
215         }
216         
217         public String getSrcPortList() {
218                 return this.srcPortList;
219         }
220
221         public void setSrcPortList(String srcPortList) {
222                 this.srcPortList = srcPortList;
223         }
224         
225         public String getDestPortList() {
226                 return this.destPortList;
227         }
228
229         public void setDestPortList(String destPortList) {
230                 this.destPortList = destPortList;
231         }
232         
233         
234         public String getAction() {
235                 return this.action;
236         }
237
238         public void setAction(String action) {
239                 this.action = action;
240         }
241
242 }