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=========================================================
23 package org.onap.policy.rest.jpa;
24 import java.io.Serializable;
25 import java.util.Date;
27 import javax.persistence.Column;
28 import javax.persistence.Entity;
29 import javax.persistence.GeneratedValue;
30 import javax.persistence.GenerationType;
31 import javax.persistence.Id;
32 import javax.persistence.JoinColumn;
33 import javax.persistence.ManyToOne;
34 import javax.persistence.NamedQueries;
35 import javax.persistence.NamedQuery;
36 import javax.persistence.OrderBy;
37 import javax.persistence.PrePersist;
38 import javax.persistence.PreUpdate;
39 import javax.persistence.Table;
40 import javax.persistence.Temporal;
41 import javax.persistence.TemporalType;
45 @Table(name="ActionPolicyDict")
47 @NamedQuery(name="ActionPolicyDict.findAll", query="SELECT e FROM ActionPolicyDict e")
49 public class ActionPolicyDict implements Serializable {
50 private static final long serialVersionUID = 1L;
52 @GeneratedValue(strategy = GenerationType.AUTO)
56 @Column(name="ATTRIBUTE_NAME", nullable=false)
58 private String attributeName;
60 @Column(name="Type", nullable=false)
64 @Column(name="URL", nullable=false)
68 @Column(name="Method", nullable=false)
70 private String method;
72 @Column(name="Headers", nullable=true)
74 private String header;
76 @Column(name="Body", nullable=true)
80 @Temporal(TemporalType.TIMESTAMP)
81 @Column(name="created_date", updatable=false)
82 private Date createdDate;
84 @Column(name="description", nullable=true, length=2048)
85 private String description;
87 @Temporal(TemporalType.TIMESTAMP)
88 @Column(name="modified_date", nullable=false)
89 private Date modifiedDate;
91 @ManyToOne(optional = false)
92 @JoinColumn(name="created_by")
93 private UserInfo userCreatedBy;
95 @ManyToOne(optional = false)
96 @JoinColumn(name="modified_by")
97 private UserInfo userModifiedBy;
99 public UserInfo getUserCreatedBy() {
100 return userCreatedBy;
103 public void setUserCreatedBy(UserInfo userCreatedBy) {
104 this.userCreatedBy = userCreatedBy;
107 public UserInfo getUserModifiedBy() {
108 return userModifiedBy;
111 public void setUserModifiedBy(UserInfo userModifiedBy) {
112 this.userModifiedBy = userModifiedBy;
116 public void prePersist() {
117 Date date = new Date();
118 this.createdDate = date;
119 this.modifiedDate = date;
122 public void preUpdate() {
123 this.modifiedDate = new Date();
128 public void setId(int id) {
132 public Date getCreatedDate() {
133 return this.createdDate;
135 public void setCreatedDate(Date createdDate) {
136 this.createdDate = createdDate;
138 public String getDescription() {
139 return this.description;
141 public void setDescription(String description) {
142 this.description = description;
145 public Date getModifiedDate() {
146 return this.modifiedDate;
148 public void setModifiedDate(Date modifiedDate) {
149 this.modifiedDate = modifiedDate;
151 public String getType() {
154 public void setType(String type) {
158 public String getUrl() {
161 public void setUrl(String url) {
164 public String getMethod() {
167 public void setMethod(String method) {
168 this.method = method;
170 public String getHeader() {
173 public void setHeader(String header) {
174 this.header = header;
177 public String getBody() {
180 public void setBody(String body) {
183 public String getAttributeName() {
184 return attributeName;
186 public void setAttributeName(String attributeName) {
187 this.attributeName = attributeName;