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=========================================================
21 package org.onap.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.JoinColumn;
32 import javax.persistence.ManyToOne;
33 import javax.persistence.NamedQuery;
34 import javax.persistence.OrderBy;
35 import javax.persistence.PrePersist;
36 import javax.persistence.PreUpdate;
37 import javax.persistence.Table;
38 import javax.persistence.Temporal;
39 import javax.persistence.TemporalType;
42 @Table(name="VarbindDictionary")
43 @NamedQuery(name = "VarbindDictionary.findAll", query = "Select v FROM VarbindDictionary v")
44 public class VarbindDictionary implements Serializable{
45 private static final long serialVersionUID = 1L;
48 @GeneratedValue(strategy = GenerationType.AUTO)
52 @Column(name ="varbind_Name", nullable = false, unique = true)
54 private String varbindName;
56 @Column(name = "varbind_Description", nullable = true, length = 2048)
57 private String varbindDescription;
59 @Column(name = "varbind_oid", nullable = false)
60 private String varbindOID;
62 @Temporal(TemporalType.TIMESTAMP)
63 @Column(name="created_date", updatable=false)
64 private Date createdDate;
66 @Temporal(TemporalType.TIMESTAMP)
67 @Column(name="modified_date", nullable=false)
68 private Date modifiedDate;
70 @ManyToOne(optional = false)
71 @JoinColumn(name="created_by")
72 private UserInfo userCreatedBy;
74 @ManyToOne(optional = false)
75 @JoinColumn(name="modified_by")
76 private UserInfo userModifiedBy;
78 public UserInfo getUserCreatedBy() {
82 public void setUserCreatedBy(UserInfo userCreatedBy) {
83 this.userCreatedBy = userCreatedBy;
86 public UserInfo getUserModifiedBy() {
87 return userModifiedBy;
90 public void setUserModifiedBy(UserInfo userModifiedBy) {
91 this.userModifiedBy = userModifiedBy;
95 public void prePersist() {
96 Date date = new Date();
97 this.createdDate = date;
98 this.modifiedDate = date;
102 public void preUpdate() {
103 this.modifiedDate = new Date();
110 public void setId(int id) {
114 public String getVarbindName() {
118 public void setVarbindName(String varbindName) {
119 this.varbindName = varbindName;
122 public String getVarbindDescription() {
123 return varbindDescription;
126 public void setVarbindDescription(String varbindDescription) {
127 this.varbindDescription = varbindDescription;
130 public String getVarbindOID() {
134 public void setVarbindOID(String varbindOID) {
135 this.varbindOID = varbindOID;
138 public Date getCreatedDate() {
142 public void setCreatedDate(Date createdDate) {
143 this.createdDate = createdDate;
146 public Date getModifiedDate() {
150 public void setModifiedDate(Date modifiedDate) {
151 this.modifiedDate = modifiedDate;