2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.policy.rest.jpa;
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;
43 @NamedQuery(name="TermList.findAll", query="SELECT e FROM TermList e")
44 public class TermList implements Serializable {
45 private static final long serialVersionUID = 1L;
48 @GeneratedValue(strategy = GenerationType.AUTO)
52 @Column(name="termName", nullable=false)
54 private String termName;
56 @Column(name="description")
57 private String termDescription;
59 @Column(name="fromzone")
60 private String fromZone;
62 @Column(name="tozone")
63 private String toZone;
65 @Column(name="srcIPList")
66 private String srcIPList;
68 @Column(name="destIPList")
69 private String destIPList;
71 @Column(name="protocolList")
72 private String protocolList;
74 @Column(name="portList")
75 private String portList;
77 @Column(name="srcPortList")
78 private String srcPortList;
80 @Column(name="destPortList")
81 private String destPortList;
83 @Column(name="action")
84 private String action;
86 @Temporal(TemporalType.TIMESTAMP)
87 @Column(name="created_date", updatable=false)
88 private Date createdDate;
90 @Temporal(TemporalType.TIMESTAMP)
91 @Column(name="modified_date", nullable=false)
92 private Date modifiedDate;
94 @ManyToOne(optional = false)
95 @JoinColumn(name="created_by")
96 private UserInfo userCreatedBy;
98 @ManyToOne(optional = false)
99 @JoinColumn(name="modified_by")
100 private UserInfo userModifiedBy;
103 this.modifiedDate = new Date();
106 public Date getCreatedDate() {
107 return this.createdDate;
109 public void setCreatedDate(Date createdDate) {
110 this.createdDate = createdDate;
113 public Date getModifiedDate() {
114 return this.modifiedDate;
116 public void setModifiedDate(Date modifiedDate) {
117 this.modifiedDate = modifiedDate;
120 public UserInfo getUserCreatedBy() {
121 return userCreatedBy;
124 public void setUserCreatedBy(UserInfo userCreatedBy) {
125 this.userCreatedBy = userCreatedBy;
128 public UserInfo getUserModifiedBy() {
129 return userModifiedBy;
132 public void setUserModifiedBy(UserInfo userModifiedBy) {
133 this.userModifiedBy = userModifiedBy;
137 public void prePersist() {
138 Date date = new Date();
139 this.createdDate = date;
140 this.modifiedDate = date;
144 public void preUpdate() {
145 this.modifiedDate = new Date();
152 public void setId(int id) {
156 public String getTermName() {
157 return this.termName;
160 public void setTermName(String termName) {
161 this.termName = termName;
164 public String getTermDescription() {
165 return this.termDescription;
168 public void setDescription(String termDescription) {
169 this.termDescription = termDescription;
172 public String getFromZone() {
173 return this.fromZone;
176 public void setFromZones(String fromZone) {
177 this.fromZone = fromZone;
180 public String getToZone() {
184 public void setToZones(String toZone) {
185 this.toZone = toZone;
188 public String getSrcIPList() {
189 return this.srcIPList;
192 public void setSrcIPList(String srcIPList) {
193 this.srcIPList = srcIPList;
196 public String getDestIPList() {
197 return this.destIPList;
200 public void setDestIPList(String destIPList) {
201 this.destIPList = destIPList;
204 public String getProtocolList() {
205 return this.protocolList;
208 public void setProtocolList(String protocolList) {
209 this.protocolList = protocolList;
212 public String getPortList() {
213 return this.portList;
216 public void setPortList(String portList) {
217 this.portList = portList;
220 public String getSrcPortList() {
221 return this.srcPortList;
224 public void setSrcPortList(String srcPortList) {
225 this.srcPortList = srcPortList;
228 public String getDestPortList() {
229 return this.destPortList;
232 public void setDestPortList(String destPortList) {
233 this.destPortList = destPortList;
237 public String getAction() {
241 public void setAction(String action) {
242 this.action = action;