2 * ============LICENSE_START=======================================================
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
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;
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;
36 * JPA for the Micro Service Models.
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;
51 @GeneratedValue(strategy = GenerationType.AUTO)
55 @Column(name = "modelName", nullable = false, unique = true)
57 private String modelName;
59 @Column(name = "description", nullable = true, length = 2048)
60 private String description;
62 @Column(name = "dependency", nullable = true, length = 2048)
63 private String dependency;
65 @Column(name = "attributes", nullable = false, length = 255)
66 private String attributes;
68 @Column(name = "ref_attributes", nullable = false, length = 255)
69 private String ref_attributes;
71 @Column(name = "sub_attributes", nullable = false, length = 2000)
72 private String sub_attributes;
74 @Column(name = "dataOrderInfo", nullable = true, length = 2000)
75 private String dataOrderInfo;
77 @Column(name = "version", nullable = false, length = 2000)
78 private String version;
80 @Column(name = "enumValues", nullable = false, length = 2000)
81 private String enumValues;
83 @Column(name = "annotation", nullable = false, length = 2000)
84 private String annotation;
86 @Column(name = "decisionModel", nullable = true)
87 private Boolean decisionModel = false;
89 @Column(name = "ruleFormation", nullable = true)
90 private String ruleFormation;
92 public String getRuleFormation() {
96 public void setRuleFormation(String ruleFormation) {
97 this.ruleFormation = ruleFormation;
100 public String getSub_attributes() {
101 return sub_attributes;
104 public void setSub_attributes(String sub_attributes) {
105 this.sub_attributes = sub_attributes;
108 public String getDataOrderInfo() {
109 return dataOrderInfo;
112 public void setDataOrderInfo(String dataOrderInfo) {
113 this.dataOrderInfo = dataOrderInfo;
116 public String getVersion() {
120 public void setVersion(String version) {
121 this.version = version;
125 @JoinColumn(name = "imported_by")
126 private UserInfo userCreatedBy;
128 public UserInfo getUserCreatedBy() {
129 return userCreatedBy;
132 public void setUserCreatedBy(UserInfo userCreatedBy) {
133 this.userCreatedBy = userCreatedBy;
136 public String getAttributes() {
140 public void setAttributes(String attributes) {
141 this.attributes = attributes;
144 public String getRef_attributes() {
145 return ref_attributes;
148 public void setRef_attributes(String ref_attributes) {
149 this.ref_attributes = ref_attributes;
156 public void setId(int id) {
160 public String getDescription() {
161 return this.description;
164 public void setDescription(String description) {
165 this.description = description;
168 public String getDependency() {
172 public void setDependency(String dependency) {
173 this.dependency = dependency;
176 public String getModelName() {
177 return this.modelName;
180 public void setModelName(String modelName) {
181 this.modelName = modelName;
184 public String getEnumValues() {
188 public void setEnumValues(String enumValues) {
189 this.enumValues = enumValues;
192 public String getAnnotation() {
196 public void setAnnotation(String annotation) {
197 this.annotation = annotation;
200 public Boolean isDecisionModel() {
201 return decisionModel;
204 public void setDecisionModel(boolean decisionModel) {
205 this.decisionModel = decisionModel;