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=========================================================
21 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.JoinColumn;
32 import javax.persistence.Lob;
33 import javax.persistence.ManyToOne;
34 import javax.persistence.NamedQuery;
35 import javax.persistence.OrderBy;
36 import javax.persistence.PrePersist;
37 import javax.persistence.Table;
38 import javax.persistence.Temporal;
39 import javax.persistence.TemporalType;
41 import org.openecomp.policy.rest.jpa.UserInfo;
44 * JPA for the BRMS Param Template.
51 @Table(name="BRMSParamTemplate")
52 @NamedQuery(name="BRMSParamTemplate.findAll", query="SELECT b FROM BRMSParamTemplate b ")
53 public class BRMSParamTemplate implements Serializable{
54 private static final long serialVersionUID = 1L;
57 @GeneratedValue(strategy = GenerationType.AUTO)
61 @Column(name="param_template_name", nullable=false, unique=true)
63 private String ruleName;
66 @Column(name="rule",nullable=false)
69 @Column(name="description", nullable=true, length=2048)
70 private String description;
72 @Temporal(TemporalType.TIMESTAMP)
73 @Column(name="created_date", updatable=false)
74 private Date createdDate;
77 @ManyToOne(optional = false)
78 @JoinColumn(name="created_by")
79 private UserInfo userCreatedBy;
81 public UserInfo getUserCreatedBy() {
85 public void setUserCreatedBy(UserInfo userCreatedBy) {
86 this.userCreatedBy = userCreatedBy;
89 public BRMSParamTemplate(){
92 public BRMSParamTemplate(String userid){
97 public void prePersist() {
98 Date date = new Date();
99 this.createdDate = date;
106 public void setId(int id) {
111 public Date getCreatedDate() {
112 return this.createdDate;
115 public void setCreatedDate(Date createdDate) {
116 this.createdDate = createdDate;
119 public String getDescription() {
120 return this.description;
123 public void setDescription(String description) {
124 this.description = description;
127 public String getRule(){
131 public void setRule(String rule){
135 public String getRuleName(){
136 return this.ruleName;
139 public void setRuleName(String ruleName){
140 this.ruleName = ruleName;