Fixed the Sonar technical debt.
[policy/engine.git] / ONAP-REST / src / main / java / org / onap / policy / rest / jpa / MicroServiceModels.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 /*
22  *                        AT&T - PROPRIETARY
23  *          THIS FILE CONTAINS PROPRIETARY INFORMATION OF
24  *        AT&T AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN
25  *             ACCORDANCE WITH APPLICABLE AGREEMENTS.
26  *
27  *          Copyright (c) 2015 AT&T Knowledge Ventures
28  *              Unpublished and Not for Publication
29  *                     All Rights Reserved
30  */
31 package org.onap.policy.rest.jpa;
32
33 import java.io.Serializable;
34
35 import javax.persistence.Column;
36 import javax.persistence.Entity;
37 import javax.persistence.GeneratedValue;
38 import javax.persistence.GenerationType;
39 import javax.persistence.Id;
40 import javax.persistence.JoinColumn;
41 import javax.persistence.ManyToOne;
42 import javax.persistence.NamedQuery;
43 import javax.persistence.OrderBy;
44 import javax.persistence.Table;
45 /*
46  * JPA for the Micro Service Models. 
47  * 
48  * @version: 0.1
49  */
50
51
52 @Entity
53 @Table(name="MicroServiceModels")
54 @NamedQuery(name="MicroServiceModels.findAll", query="SELECT b FROM MicroServiceModels b ")
55 public class MicroServiceModels implements Serializable{
56         private static final long serialVersionUID = 1L;
57         
58         @Id
59         @GeneratedValue(strategy = GenerationType.AUTO)
60         @Column(name="id")
61         private int id;
62         
63         @Column(name="modelName", nullable=false, unique=true)
64         @OrderBy("asc")
65         private String modelName;
66         
67         @Column(name="description", nullable=true, length=2048)
68         private String description;
69         
70         @Column(name="dependency", nullable=true, length=2048)
71         private String dependency;
72
73         @Column(name="attributes", nullable=false, length=255)
74         private String attributes;
75         
76         @Column(name="ref_attributes", nullable=false, length=255)
77         private String ref_attributes;
78
79         @Column (name="sub_attributes", nullable=false, length=2000)
80         private String sub_attributes;
81         
82         @Column (name="version", nullable=false, length=2000)
83         private String version;
84         
85         @Column (name="enumValues", nullable=false, length=2000)
86         private String enumValues;
87         
88         @Column (name="annotation", nullable=false, length=2000)
89         private String annotation;
90         
91         public String getSub_attributes() {
92                 return sub_attributes;
93         }
94
95         public void setSub_attributes(String sub_attributes) {
96                 this.sub_attributes = sub_attributes;
97         }
98
99         public String getVersion() {
100                 return version;
101         }
102
103         public void setVersion(String version) {
104                 this.version = version;
105         }
106
107         @ManyToOne
108         @JoinColumn(name="imported_by")
109         private UserInfo userCreatedBy;
110         
111         public UserInfo getUserCreatedBy() {
112                 return userCreatedBy;
113         }
114
115         public void setUserCreatedBy(UserInfo userCreatedBy) {
116                 this.userCreatedBy = userCreatedBy;
117         }
118         
119         public MicroServiceModels(){
120                 //An empty constructor
121         }
122         
123         public MicroServiceModels(String userid){
124                 //An empty constructor
125         }
126
127         public String getAttributes() {
128                 return attributes;
129         }
130
131         public void setAttributes(String attributes) {
132                 this.attributes = attributes;
133         }
134
135         public String getRef_attributes() {
136                 return ref_attributes;
137         }
138
139         public void setRef_attributes(String ref_attributes) {
140                 this.ref_attributes = ref_attributes;
141         }
142
143         public int getId() {
144                 return this.id;
145         }
146         
147         public void setId(int id) {
148                 this.id = id;
149         }
150         
151         public String getDescription() {
152                 return this.description;
153         }
154
155         public void setDescription(String description) {
156                 this.description = description;
157         }
158         
159         public String getDependency() {
160                 return dependency;
161         }
162
163         public void setDependency(String dependency) {
164                 this.dependency = dependency;
165         }
166         
167         public String getModelName(){
168                 return this.modelName;
169         }
170         
171         public void setModelName(String modelName){
172                 this.modelName = modelName;
173         }
174         
175         public String getEnumValues() {
176                 return enumValues;
177         }
178
179         public void setEnumValues(String enumValues) {
180                 this.enumValues = enumValues;
181         }
182         
183         public String getAnnotation() {
184                 return annotation;
185         }
186
187         public void setAnnotation(String annotation) {
188                 this.annotation = annotation;
189         }
190 }