2 * ============LICENSE_START=======================================================
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
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;
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;
44 @NamedQuery(name="TermList.findAll", query="SELECT e FROM TermList e")
45 public class TermList implements Serializable {
46 private static final long serialVersionUID = 1L;
49 @GeneratedValue(strategy = GenerationType.AUTO)
53 @Column(name="termName", nullable=false)
55 private String termName;
57 @Column(name="description")
58 private String termDescription;
60 @Column(name="fromzone")
61 private String fromZone;
63 @Column(name="tozone")
64 private String toZone;
66 @Column(name="srcIPList")
67 private String srcIPList;
69 @Column(name="destIPList")
70 private String destIPList;
72 @Column(name="protocolList")
73 private String protocolList;
75 @Column(name="portList")
76 private String portList;
78 @Column(name="srcPortList")
79 private String srcPortList;
81 @Column(name="destPortList")
82 private String destPortList;
84 @Column(name="action")
85 private String action;
87 @Temporal(TemporalType.TIMESTAMP)
88 @Column(name="created_date", updatable=false)
89 private Date createdDate;
91 @Temporal(TemporalType.TIMESTAMP)
92 @Column(name="modified_date", nullable=false)
93 private Date modifiedDate;
95 @ManyToOne(optional = false)
96 @JoinColumn(name="created_by")
97 private UserInfo userCreatedBy;
99 @ManyToOne(optional = false)
100 @JoinColumn(name="modified_by")
101 private UserInfo userModifiedBy;
103 public Date getCreatedDate() {
104 return this.createdDate;
106 public void setCreatedDate(Date createdDate) {
107 this.createdDate = createdDate;
110 public Date getModifiedDate() {
111 return this.modifiedDate;
113 public void setModifiedDate(Date modifiedDate) {
114 this.modifiedDate = modifiedDate;
117 public UserInfo getUserCreatedBy() {
118 return userCreatedBy;
121 public void setUserCreatedBy(UserInfo userCreatedBy) {
122 this.userCreatedBy = userCreatedBy;
125 public UserInfo getUserModifiedBy() {
126 return userModifiedBy;
129 public void setUserModifiedBy(UserInfo userModifiedBy) {
130 this.userModifiedBy = userModifiedBy;
134 public void prePersist() {
135 Date date = new Date();
136 this.createdDate = date;
137 this.modifiedDate = date;
141 public void preUpdate() {
142 this.modifiedDate = new Date();
149 public void setId(int id) {
153 public String getTermName() {
154 return this.termName;
157 public void setTermName(String termName) {
158 this.termName = termName;
161 public String getTermDescription() {
162 return this.termDescription;
165 public void setDescription(String termDescription) {
166 this.termDescription = termDescription;
169 public String getFromZone() {
170 return this.fromZone;
173 public void setFromZones(String fromZone) {
174 this.fromZone = fromZone;
177 public String getToZone() {
181 public void setToZones(String toZone) {
182 this.toZone = toZone;
185 public String getSrcIPList() {
186 return this.srcIPList;
189 public void setSrcIPList(String srcIPList) {
190 this.srcIPList = srcIPList;
193 public String getDestIPList() {
194 return this.destIPList;
197 public void setDestIPList(String destIPList) {
198 this.destIPList = destIPList;
201 public String getProtocolList() {
202 return this.protocolList;
205 public void setProtocolList(String protocolList) {
206 this.protocolList = protocolList;
209 public String getPortList() {
210 return this.portList;
213 public void setPortList(String portList) {
214 this.portList = portList;
217 public String getSrcPortList() {
218 return this.srcPortList;
221 public void setSrcPortList(String srcPortList) {
222 this.srcPortList = srcPortList;
225 public String getDestPortList() {
226 return this.destPortList;
229 public void setDestPortList(String destPortList) {
230 this.destPortList = destPortList;
234 public String getAction() {
238 public void setAction(String action) {
239 this.action = action;