Fixed the Sonar technical debt.
[policy/engine.git] / ONAP-REST / src / main / java / org / onap / policy / rest / jpa / MicroServiceAttribute.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP-REST
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.policy.rest.jpa;
22
23 import java.io.Serializable;
24
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.NamedQuery;
31 import javax.persistence.OrderBy;
32 import javax.persistence.PrePersist;
33 import javax.persistence.PreUpdate;
34 import javax.persistence.Table;
35
36 @Entity
37 @Table(name="MicroServiceAttribute")
38 @NamedQuery(name="MicroServiceAttribute.findAll", query="SELECT e FROM MicroServiceAttribute e ")
39 public class MicroServiceAttribute implements Serializable {
40         private static final long serialVersionUID = 1L;
41
42         private static String domain;
43
44         @Id
45         @GeneratedValue(strategy = GenerationType.AUTO)
46         @Column(name="id")
47         private int id;
48         
49         @Column(name="name", nullable=false)
50         @OrderBy("asc")
51         private String name;
52         
53         @Column(name="value")
54         private String value ;
55
56         @Column(name="modelName")
57         private String modelName;
58         
59
60         public MicroServiceAttribute() {
61                 //An empty constructor
62         }
63         public MicroServiceAttribute(String string, String userid) {
64                 this(domain);
65                 
66         }
67         public MicroServiceAttribute(String domain) {
68                 //An empty constructor
69         }       
70
71         @PrePersist
72         public void     prePersist() {
73                 //An empty function
74         }
75         @PreUpdate
76         public void preUpdate() {
77                 //An empty function
78         }
79
80         
81         public int getId() {
82                 return this.id;
83         }
84
85         public void setId(int id) {
86                 this.id = id;
87         }
88         public String getName() {
89                 return this.name;
90         }
91
92         public void setName(String name) {
93                 this.name = name;
94
95         }
96         public String getValue() {
97                 return this.value ;
98         }
99
100         public void setValue(String value ) {
101                 this.value  = value ;
102         }
103         public String getModelName() {
104                 return modelName;
105         }
106         public void setModelName(String modelName) {
107                 this.modelName = modelName;
108         }
109         
110 }