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;
41 @Table(name="VarbindDictionary")
42 @NamedQuery(name = "VarbindDictionary.findAll", query = "Select v FROM VarbindDictionary v")
43 public class VarbindDictionary implements Serializable{
44 private static final long serialVersionUID = 1L;
47 @GeneratedValue(strategy = GenerationType.AUTO)
51 @Column(name ="varbind_Name", nullable = false, unique = true)
53 private String varbindName;
55 @Column(name = "varbind_Description", nullable = true, length = 2048)
56 private String varbindDescription;
58 @Column(name = "varbind_oid", nullable = false)
59 private String varbindOID;
61 @Temporal(TemporalType.TIMESTAMP)
62 @Column(name="created_date", updatable=false)
63 private Date createdDate;
65 @Temporal(TemporalType.TIMESTAMP)
66 @Column(name="modified_date", nullable=false)
67 private Date modifiedDate;
69 @ManyToOne(optional = false)
70 @JoinColumn(name="created_by")
71 private UserInfo userCreatedBy;
73 @ManyToOne(optional = false)
74 @JoinColumn(name="modified_by")
75 private UserInfo userModifiedBy;
77 public VarbindDictionary() {
78 this.setModifiedDate(new Date());
82 public UserInfo getUserCreatedBy() {
86 public void setUserCreatedBy(UserInfo userCreatedBy) {
87 this.userCreatedBy = userCreatedBy;
90 public UserInfo getUserModifiedBy() {
91 return userModifiedBy;
94 public void setUserModifiedBy(UserInfo userModifiedBy) {
95 this.userModifiedBy = userModifiedBy;
99 public void prePersist() {
100 Date date = new Date();
101 this.createdDate = date;
102 this.modifiedDate = date;
106 public void preUpdate() {
107 this.modifiedDate = new Date();
114 public void setId(int id) {
118 public String getVarbindName() {
122 public void setVarbindName(String varbindName) {
123 this.varbindName = varbindName;
126 public String getVarbindDescription() {
127 return varbindDescription;
130 public void setVarbindDescription(String varbindDescription) {
131 this.varbindDescription = varbindDescription;
134 public String getVarbindOID() {
138 public void setVarbindOID(String varbindOID) {
139 this.varbindOID = varbindOID;
142 public Date getCreatedDate() {
146 public void setCreatedDate(Date createdDate) {
147 this.createdDate = createdDate;
150 public Date getModifiedDate() {
154 public void setModifiedDate(Date modifiedDate) {
155 this.modifiedDate = modifiedDate;