e9a29446d0c74628bcd94914c9c0841a1c3f0633
[policy/engine.git] / ONAP-REST / src / main / java / org / onap / policy / rest / jpa / ActionPolicyDict.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 /*
22  */
23 package org.onap.policy.rest.jpa;
24 import java.io.Serializable;
25 import java.util.Date;
26
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;
42
43
44 @Entity
45 @Table(name="ActionPolicyDict")
46 @NamedQueries({
47     @NamedQuery(name="ActionPolicyDict.findAll", query="SELECT e FROM ActionPolicyDict e")
48 })
49 public class ActionPolicyDict implements Serializable {
50     private static final long serialVersionUID = 1L;
51     @Id
52     @GeneratedValue(strategy = GenerationType.AUTO)
53     @Column(name="id")
54     private int id;
55
56     @Column(name="ATTRIBUTE_NAME", nullable=false)
57     @OrderBy("asc")
58     private String attributeName;
59
60     @Column(name="Type", nullable=false)
61     @OrderBy("asc")
62     private String type;
63
64     @Column(name="URL", nullable=false)
65     @OrderBy("asc")
66     private String url;
67
68     @Column(name="Method", nullable=false)
69     @OrderBy("asc")
70     private String method;
71
72     @Column(name="Headers", nullable=true)
73     @OrderBy("asc")
74     private String header;
75
76     @Column(name="Body", nullable=true)
77     @OrderBy("asc")
78     private String body;
79
80     @Temporal(TemporalType.TIMESTAMP)
81     @Column(name="created_date", updatable=false)
82     private Date createdDate;
83
84     @Column(name="description", nullable=true, length=2048)
85     private String description;
86
87     @Temporal(TemporalType.TIMESTAMP)
88     @Column(name="modified_date", nullable=false)
89     private Date modifiedDate;
90
91     @ManyToOne(optional = false)
92     @JoinColumn(name="created_by")
93     private UserInfo userCreatedBy;
94
95     @ManyToOne(optional = false)
96     @JoinColumn(name="modified_by")
97     private UserInfo userModifiedBy;
98
99     public UserInfo getUserCreatedBy() {
100         return userCreatedBy;
101     }
102
103     public void setUserCreatedBy(UserInfo userCreatedBy) {
104         this.userCreatedBy = userCreatedBy;
105     }
106
107     public UserInfo getUserModifiedBy() {
108         return userModifiedBy;
109     }
110
111     public void setUserModifiedBy(UserInfo userModifiedBy) {
112         this.userModifiedBy = userModifiedBy;
113     }
114
115     @PrePersist
116     public void prePersist() {
117         Date date = new Date();
118         this.createdDate = date;
119         this.modifiedDate = date;
120     }
121     @PreUpdate
122     public void preUpdate() {
123         this.modifiedDate = new Date();
124     }
125     public int getId() {
126         return this.id;
127     }
128     public void setId(int id) {
129         this.id = id;
130     }
131
132     public Date getCreatedDate() {
133         return this.createdDate;
134     }
135     public void setCreatedDate(Date createdDate) {
136         this.createdDate = createdDate;
137     }
138     public String getDescription() {
139         return this.description;
140     }
141     public void setDescription(String description) {
142         this.description = description;
143     }
144
145     public Date getModifiedDate() {
146         return this.modifiedDate;
147     }
148     public void setModifiedDate(Date modifiedDate) {
149         this.modifiedDate = modifiedDate;
150     }
151     public String getType() {
152         return type;
153     }
154     public void setType(String type) {
155         this.type = type;
156     }
157
158     public String getUrl() {
159         return url;
160     }
161     public void setUrl(String url) {
162         this.url = url;
163     }
164     public String getMethod() {
165         return method;
166     }
167     public void setMethod(String method) {
168         this.method = method;
169     }
170     public String getHeader() {
171         return header;
172     }
173     public void setHeader(String header) {
174         this.header = header;
175     }
176
177     public String getBody() {
178         return body;
179     }
180     public void setBody(String body) {
181         this.body = body;
182     }
183     public String getAttributeName() {
184         return attributeName;
185     }
186     public void setAttributeName(String attributeName) {
187         this.attributeName = attributeName;
188     }
189 }