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=========================================================
20 package org.onap.policy.rest.jpa;
22 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.NamedQuery;
32 import javax.persistence.OrderBy;
33 import javax.persistence.Table;
35 * JPA for the Micro Service Models.
42 @Table(name="MicroServiceModels")
43 @NamedQuery(name="MicroServiceModels.findAll", query="SELECT b FROM MicroServiceModels b ")
44 public class MicroServiceModels implements Serializable{
45 private static final long serialVersionUID = 1L;
48 @GeneratedValue(strategy = GenerationType.AUTO)
52 @Column(name="modelName", nullable=false, unique=true)
54 private String modelName;
56 @Column(name="description", nullable=true, length=2048)
57 private String description;
59 @Column(name="dependency", nullable=true, length=2048)
60 private String dependency;
62 @Column(name="attributes", nullable=false, length=255)
63 private String attributes;
65 @Column(name="ref_attributes", nullable=false, length=255)
66 private String ref_attributes;
68 @Column (name="sub_attributes", nullable=false, length=2000)
69 private String sub_attributes;
71 @Column (name="version", nullable=false, length=2000)
72 private String version;
74 @Column (name="enumValues", nullable=false, length=2000)
75 private String enumValues;
77 @Column (name="annotation", nullable=false, length=2000)
78 private String annotation;
80 public String getSub_attributes() {
81 return sub_attributes;
84 public void setSub_attributes(String sub_attributes) {
85 this.sub_attributes = sub_attributes;
88 public String getVersion() {
92 public void setVersion(String version) {
93 this.version = version;
97 @JoinColumn(name="imported_by")
98 private UserInfo userCreatedBy;
100 public UserInfo getUserCreatedBy() {
101 return userCreatedBy;
104 public void setUserCreatedBy(UserInfo userCreatedBy) {
105 this.userCreatedBy = userCreatedBy;
108 public MicroServiceModels(){
109 //An empty constructor
112 public MicroServiceModels(String userid){
113 //An empty constructor
116 public String getAttributes() {
120 public void setAttributes(String attributes) {
121 this.attributes = attributes;
124 public String getRef_attributes() {
125 return ref_attributes;
128 public void setRef_attributes(String ref_attributes) {
129 this.ref_attributes = ref_attributes;
136 public void setId(int id) {
140 public String getDescription() {
141 return this.description;
144 public void setDescription(String description) {
145 this.description = description;
148 public String getDependency() {
152 public void setDependency(String dependency) {
153 this.dependency = dependency;
156 public String getModelName(){
157 return this.modelName;
160 public void setModelName(String modelName){
161 this.modelName = modelName;
164 public String getEnumValues() {
168 public void setEnumValues(String enumValues) {
169 this.enumValues = enumValues;
172 public String getAnnotation() {
176 public void setAnnotation(String annotation) {
177 this.annotation = annotation;