2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 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=========================================================
20 package org.openecomp.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.Lob;
32 import javax.persistence.NamedQueries;
33 import javax.persistence.NamedQuery;
34 import javax.persistence.PrePersist;
35 import javax.persistence.PreUpdate;
36 import javax.persistence.SequenceGenerator;
37 import javax.persistence.Table;
38 import javax.persistence.Temporal;
39 import javax.persistence.TemporalType;
40 import javax.persistence.Version;
42 * The Entity class to persist a policy object Action Body
45 import com.fasterxml.jackson.annotation.JsonBackReference;
48 @Table(name="ActionBodyEntity")
50 @NamedQuery(name=" ActionBodyEntity.findAll", query="SELECT e FROM ActionBodyEntity e "),
51 @NamedQuery(name="ActionBodyEntity.deleteAll", query="DELETE FROM ActionBodyEntity WHERE 1=1")
53 //@SequenceGenerator(name="seqActBody", initialValue=1, allocationSize=1)
55 public class ActionBodyEntity implements Serializable {
56 private static final long serialVersionUID = 1L;
59 //@GeneratedValue(strategy = GenerationType.SEQUENCE, generator="seqActBody")
60 @GeneratedValue(strategy = GenerationType.AUTO)
61 @Column(name="actionBodyId")
63 private long actionBodyId;
65 @Column(name="actionBodyName", nullable=false, length=255)
66 private String actionBodyName = "";
69 @Column(name="version")
73 @Column(name="actionBody", nullable=false, columnDefinition="TEXT")
74 private String actionBody = "NoBody";
76 @Column(name="created_by", nullable=false, length=255)
77 private String createdBy = "guest";
79 @Temporal(TemporalType.TIMESTAMP)
80 @Column(name="created_date", updatable=false)
81 private Date createdDate;
83 @Column(name="modified_by", nullable=false, length=255)
84 private String modifiedBy = "guest";
86 @Temporal(TemporalType.TIMESTAMP)
87 @Column(name="modified_date", nullable=false)
88 private Date modifiedDate;
90 @Column(name="deleted", nullable=false)
91 private boolean deleted = false;
93 public ActionBodyEntity() {
97 public void prePersist() {
98 Date date = new Date();
99 this.createdDate = date;
100 this.modifiedDate = date;
104 public void preUpdate() {
105 this.modifiedDate = new Date();
108 * @return the configurationDataId
110 public long getActionBodyId() {
114 * @param configurationDataId the configurationDataId to set
116 public void setActionBodyName(String name) {
117 this.actionBodyName = name;
119 public String getActionBodyName(){
120 return this.actionBodyName;
124 * @return the actionBody
126 public String getActionBody() {
130 * @param configBody the configBody to set
132 public void setActionBody(String body) {
133 this.actionBody = body;
136 * @return the createdBy
138 public String getCreatedBy() {
142 * @param createdBy the createdBy to set
144 public void setCreatedBy(String createdBy) {
145 this.createdBy = createdBy;
149 * @return the modifiedBy
151 public String getModifiedBy() {
155 * @param modifiedBy the modifiedBy to set
157 public void setModifiedBy(String modifiedBy) {
158 this.modifiedBy = modifiedBy;
161 * @return the modifiedDate
163 public Date getModifiedDate() {
167 * @param modifiedDate the modifiedDate to set
169 public void setModifiedDate(Date modifiedDate) {
170 this.modifiedDate = modifiedDate;
173 * @return the version
175 public int getVersion() {
179 * @return the createdDate
181 public Date getCreatedDate() {
186 * @return the deleted
188 public boolean isDeleted() {
193 * @param deleted the deleted to set
195 public void setDeleted(boolean deleted) {
196 this.deleted = deleted;