Merge "Added Junits for Policy PAP-REST"
[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-2018 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 package org.onap.policy.rest.jpa;
21
22 import java.io.Serializable;
23
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;
34 /*
35  * JPA for the Micro Service Models. 
36  * 
37  * @version: 0.1
38  */
39
40
41 @Entity
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;
46         
47         @Id
48         @GeneratedValue(strategy = GenerationType.AUTO)
49         @Column(name="id")
50         private int id;
51         
52         @Column(name="modelName", nullable=false, unique=true)
53         @OrderBy("asc")
54         private String modelName;
55         
56         @Column(name="description", nullable=true, length=2048)
57         private String description;
58         
59         @Column(name="dependency", nullable=true, length=2048)
60         private String dependency;
61
62         @Column(name="attributes", nullable=false, length=255)
63         private String attributes;
64         
65         @Column(name="ref_attributes", nullable=false, length=255)
66         private String ref_attributes;
67
68         @Column (name="sub_attributes", nullable=false, length=2000)
69         private String sub_attributes;
70         
71         @Column (name="version", nullable=false, length=2000)
72         private String version;
73         
74         @Column (name="enumValues", nullable=false, length=2000)
75         private String enumValues;
76         
77         @Column (name="annotation", nullable=false, length=2000)
78         private String annotation;
79         
80         public String getSub_attributes() {
81                 return sub_attributes;
82         }
83
84         public void setSub_attributes(String sub_attributes) {
85                 this.sub_attributes = sub_attributes;
86         }
87
88         public String getVersion() {
89                 return version;
90         }
91
92         public void setVersion(String version) {
93                 this.version = version;
94         }
95
96         @ManyToOne
97         @JoinColumn(name="imported_by")
98         private UserInfo userCreatedBy;
99         
100         public UserInfo getUserCreatedBy() {
101                 return userCreatedBy;
102         }
103
104         public void setUserCreatedBy(UserInfo userCreatedBy) {
105                 this.userCreatedBy = userCreatedBy;
106         }
107         
108         public String getAttributes() {
109                 return attributes;
110         }
111
112         public void setAttributes(String attributes) {
113                 this.attributes = attributes;
114         }
115
116         public String getRef_attributes() {
117                 return ref_attributes;
118         }
119
120         public void setRef_attributes(String ref_attributes) {
121                 this.ref_attributes = ref_attributes;
122         }
123
124         public int getId() {
125                 return this.id;
126         }
127         
128         public void setId(int id) {
129                 this.id = id;
130         }
131         
132         public String getDescription() {
133                 return this.description;
134         }
135
136         public void setDescription(String description) {
137                 this.description = description;
138         }
139         
140         public String getDependency() {
141                 return dependency;
142         }
143
144         public void setDependency(String dependency) {
145                 this.dependency = dependency;
146         }
147         
148         public String getModelName(){
149                 return this.modelName;
150         }
151         
152         public void setModelName(String modelName){
153                 this.modelName = modelName;
154         }
155         
156         public String getEnumValues() {
157                 return enumValues;
158         }
159
160         public void setEnumValues(String enumValues) {
161                 this.enumValues = enumValues;
162         }
163         
164         public String getAnnotation() {
165                 return annotation;
166         }
167
168         public void setAnnotation(String annotation) {
169                 this.annotation = annotation;
170         }
171 }