Merge "Remove duplicated code"
[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-2019 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 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.GeneratedValue;
27 import javax.persistence.GenerationType;
28 import javax.persistence.Id;
29 import javax.persistence.JoinColumn;
30 import javax.persistence.ManyToOne;
31 import javax.persistence.NamedQueries;
32 import javax.persistence.NamedQuery;
33 import javax.persistence.OrderBy;
34 import javax.persistence.Table;
35 /*
36  * JPA for the Micro Service Models.
37  *
38  * @version: 0.1
39  */
40
41
42 @Entity
43 @Table(name = "MicroServiceModels")
44 @NamedQueries({@NamedQuery(name = "MicroServiceModels.findAll", query = "SELECT b FROM MicroServiceModels b "),
45         @NamedQuery(name = "MicroServiceModels.findAllDecision",
46                 query = "SELECT b FROM MicroServiceModels b WHERE b.decisionModel=1")})
47 public class MicroServiceModels implements Serializable {
48     private static final long serialVersionUID = 1L;
49
50     @Id
51     @GeneratedValue(strategy = GenerationType.AUTO)
52     @Column(name = "id")
53     private int id;
54
55     @Column(name = "modelName", nullable = false, unique = true)
56     @OrderBy("asc")
57     private String modelName;
58
59     @Column(name = "description", nullable = true, length = 2048)
60     private String description;
61
62     @Column(name = "dependency", nullable = true, length = 2048)
63     private String dependency;
64
65     @Column(name = "attributes", nullable = false, length = 255)
66     private String attributes;
67
68     @Column(name = "ref_attributes", nullable = false, length = 255)
69     private String ref_attributes;
70
71     @Column(name = "sub_attributes", nullable = false, length = 2000)
72     private String sub_attributes;
73
74     @Column(name = "dataOrderInfo", nullable = true, length = 2000)
75     private String dataOrderInfo;
76
77     @Column(name = "version", nullable = false, length = 2000)
78     private String version;
79
80     @Column(name = "enumValues", nullable = false, length = 2000)
81     private String enumValues;
82
83     @Column(name = "annotation", nullable = false, length = 2000)
84     private String annotation;
85
86     @Column(name = "decisionModel", nullable = true)
87     private Boolean decisionModel = false;
88
89     @Column(name = "ruleFormation", nullable = true)
90     private String ruleFormation;
91
92     public String getRuleFormation() {
93         return ruleFormation;
94     }
95
96     public void setRuleFormation(String ruleFormation) {
97         this.ruleFormation = ruleFormation;
98     }
99
100     public String getSub_attributes() {
101         return sub_attributes;
102     }
103
104     public void setSub_attributes(String sub_attributes) {
105         this.sub_attributes = sub_attributes;
106     }
107
108     public String getDataOrderInfo() {
109         return dataOrderInfo;
110     }
111
112     public void setDataOrderInfo(String dataOrderInfo) {
113         this.dataOrderInfo = dataOrderInfo;
114     }
115
116     public String getVersion() {
117         return version;
118     }
119
120     public void setVersion(String version) {
121         this.version = version;
122     }
123
124     @ManyToOne
125     @JoinColumn(name = "imported_by")
126     private UserInfo userCreatedBy;
127
128     public UserInfo getUserCreatedBy() {
129         return userCreatedBy;
130     }
131
132     public void setUserCreatedBy(UserInfo userCreatedBy) {
133         this.userCreatedBy = userCreatedBy;
134     }
135
136     public String getAttributes() {
137         return attributes;
138     }
139
140     public void setAttributes(String attributes) {
141         this.attributes = attributes;
142     }
143
144     public String getRef_attributes() {
145         return ref_attributes;
146     }
147
148     public void setRef_attributes(String ref_attributes) {
149         this.ref_attributes = ref_attributes;
150     }
151
152     public int getId() {
153         return this.id;
154     }
155
156     public void setId(int id) {
157         this.id = id;
158     }
159
160     public String getDescription() {
161         return this.description;
162     }
163
164     public void setDescription(String description) {
165         this.description = description;
166     }
167
168     public String getDependency() {
169         return dependency;
170     }
171
172     public void setDependency(String dependency) {
173         this.dependency = dependency;
174     }
175
176     public String getModelName() {
177         return this.modelName;
178     }
179
180     public void setModelName(String modelName) {
181         this.modelName = modelName;
182     }
183
184     public String getEnumValues() {
185         return enumValues;
186     }
187
188     public void setEnumValues(String enumValues) {
189         this.enumValues = enumValues;
190     }
191
192     public String getAnnotation() {
193         return annotation;
194     }
195
196     public void setAnnotation(String annotation) {
197         this.annotation = annotation;
198     }
199
200     public Boolean isDecisionModel() {
201         return decisionModel;
202     }
203
204     public void setDecisionModel(boolean decisionModel) {
205         this.decisionModel = decisionModel;
206     }
207 }
208