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;
42 @Table(name="VSCLAction")
43 @NamedQuery(name="VSCLAction.findAll", query="SELECT v FROM VSCLAction v ")
44 public class VSCLAction implements Serializable {
45 private static final long serialVersionUID = 1L;
48 @GeneratedValue(strategy = GenerationType.AUTO)
52 @Column(name="vscl_action", nullable=false, unique=true)
54 private String vsclaction;
56 @Temporal(TemporalType.TIMESTAMP)
57 @Column(name="created_date", updatable=false)
58 private Date createdDate;
60 @Column(name="description", nullable=true, length=2048)
61 private String description;
63 @Temporal(TemporalType.TIMESTAMP)
64 @Column(name="modified_date", nullable=false)
65 private Date modifiedDate;
67 @ManyToOne(optional = false)
68 @JoinColumn(name="created_by")
69 private UserInfo userCreatedBy;
71 @ManyToOne(optional = false)
72 @JoinColumn(name="modified_by")
73 private UserInfo userModifiedBy;
76 this.setModifiedDate(new Date());
79 public UserInfo getUserCreatedBy() {
83 public void setUserCreatedBy(UserInfo userCreatedBy) {
84 this.userCreatedBy = userCreatedBy;
87 public UserInfo getUserModifiedBy() {
88 return userModifiedBy;
91 public void setUserModifiedBy(UserInfo userModifiedBy) {
92 this.userModifiedBy = userModifiedBy;
96 public void prePersist() {
97 Date date = new Date();
98 this.createdDate = date;
99 this.modifiedDate = date;
103 public void preUpdate() {
104 this.modifiedDate = new Date();
111 public void setId(int id) {
115 public String getVsclaction() {
119 public void setVsclaction(String vsclaction) {
120 this.vsclaction = vsclaction;
124 public Date getCreatedDate() {
125 return this.createdDate;
128 public void setCreatedDate(Date createdDate) {
129 this.createdDate = createdDate;
132 public String getDescription() {
133 return this.description;
136 public void setDescription(String description) {
137 this.description = description;
140 public Date getModifiedDate() {
141 return this.modifiedDate;
144 public void setModifiedDate(Date modifiedDate) {
145 this.modifiedDate = modifiedDate;