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