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.onap.policy.rest.jpa;
23 import java.io.Serializable;
25 import javax.persistence.*;
29 * The persistent class for the PIPConfigParams database table.
33 @Table(name="PIPConfigParams")
34 @NamedQuery(name="PIPConfigParam.findAll", query="SELECT p FROM PIPConfigParam p")
35 public class PIPConfigParam implements Serializable {
36 private static final long serialVersionUID = 1L;
39 @GeneratedValue(strategy=GenerationType.AUTO)
43 @Column(name="PARAM_NAME", nullable=false, length=1024)
44 private String paramName;
46 @Column(name="PARAM_VALUE", nullable=false, length=2048)
47 private String paramValue;
49 @Column(name="PARAM_DEFAULT", nullable=true, length=2048)
50 private String paramDefault = null;
52 @Column(name="REQUIRED", nullable=false)
53 private char required = '0';
55 //bi-directional many-to-one association to PIPConfiguration
57 @JoinColumn(name="PIP_ID")
58 private PIPConfiguration pipconfiguration;
60 public PIPConfigParam() {
61 //An empty constructor
64 public PIPConfigParam(String param) {
65 this.paramName = param;
68 public PIPConfigParam(String param, String value) {
70 this.paramValue = value;
73 public PIPConfigParam(PIPConfigParam param) {
74 this(param.getParamName(), param.getParamValue());
75 this.paramDefault = param.getParamDefault();
76 this.required = param.required;
83 public void setId(int id) {
87 public String getParamName() {
88 return this.paramName;
91 public void setParamName(String paramName) {
92 this.paramName = paramName;
95 public String getParamValue() {
96 return this.paramValue;
99 public void setParamValue(String paramValue) {
100 this.paramValue = paramValue;
103 public String getParamDefault() {
107 public void setParamDefault(String paramDefault) {
108 this.paramDefault = paramDefault;
111 public char getRequired() {
115 public void setRequired(char required) {
116 this.required = required;
119 public PIPConfiguration getPipconfiguration() {
120 return this.pipconfiguration;
123 public void setPipconfiguration(PIPConfiguration pipconfiguration) {
124 this.pipconfiguration = pipconfiguration;
128 public boolean isRequired() {
129 return this.required == '1';
133 public void setRequired(boolean required) {
135 this.setRequired('1');
137 this.setRequired('0');
143 public String toString() {
144 return "PIPConfigParam [id=" + id + ", paramName=" + paramName
145 + ", paramValue=" + paramValue + ", required=" + required + "]";