Initial OpenECOMP policy/engine commit
[policy/engine.git] / ECOMP-REST / src / main / java / org / openecomp / policy / rest / jpa / MicroServiceModels.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ECOMP-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.openecomp.policy.rest.jpa;
32
33 import java.io.Serializable;
34 import java.util.Date;
35
36 import javax.persistence.Column;
37 import javax.persistence.Entity;
38 import javax.persistence.GeneratedValue;
39 import javax.persistence.GenerationType;
40 import javax.persistence.Id;
41 import javax.persistence.JoinColumn;
42 import javax.persistence.ManyToOne;
43 import javax.persistence.NamedQuery;
44 import javax.persistence.OrderBy;
45 import javax.persistence.Table;
46 /*
47  * JPA for the Micro Service Models. 
48  * 
49  * @version: 0.1
50  */
51 import javax.persistence.Temporal;
52 import javax.persistence.TemporalType;
53
54 import org.openecomp.policy.rest.jpa.UserInfo;
55
56
57 @Entity
58 @Table(name="MicroServiceModels")
59 @NamedQuery(name="MicroServiceModels.findAll", query="SELECT b FROM MicroServiceModels b ")
60 public class MicroServiceModels implements Serializable{
61         private static final long serialVersionUID = 1L;
62         
63         @Id
64         @GeneratedValue(strategy = GenerationType.AUTO)
65         @Column(name="id")
66         private int id;
67         
68         @Column(name="modelName", nullable=false, unique=true)
69         @OrderBy("asc")
70         private String modelName;
71         
72         @Column(name="description", nullable=true, length=2048)
73         private String description;
74         
75         @Column(name="dependency", nullable=true, length=2048)
76         private String dependency;
77
78         @Column(name="attributes", nullable=false, length=255)
79         private String attributes;
80         
81         @Column(name="ref_attributes", nullable=false, length=255)
82         private String ref_attributes;
83
84         @Column (name="sub_attributes", nullable=false, length=2000)
85         private String sub_attributes;
86         
87         @Column (name="version", nullable=false, length=2000)
88         private String version;
89         
90         public String getSub_attributes() {
91                 return sub_attributes;
92         }
93
94         public void setSub_attributes(String sub_attributes) {
95                 this.sub_attributes = sub_attributes;
96         }
97
98         public String getVersion() {
99                 return version;
100         }
101
102         public void setVersion(String version) {
103                 this.version = version;
104         }
105
106         @ManyToOne
107         @JoinColumn(name="imported_by")
108         private UserInfo userCreatedBy;
109         
110         public UserInfo getUserCreatedBy() {
111                 return userCreatedBy;
112         }
113
114         public void setUserCreatedBy(UserInfo userCreatedBy) {
115                 this.userCreatedBy = userCreatedBy;
116         }
117         
118         public MicroServiceModels(){
119         }
120         
121         public MicroServiceModels(String userid){
122         
123         }
124
125         public String getAttributes() {
126                 return attributes;
127         }
128
129         public void setAttributes(String attributes) {
130                 this.attributes = attributes;
131         }
132
133         public String getRef_attributes() {
134                 return ref_attributes;
135         }
136
137         public void setRef_attributes(String ref_attributes) {
138                 this.ref_attributes = ref_attributes;
139         }
140
141         public int getId() {
142                 return this.id;
143         }
144         
145         public void setId(int id) {
146                 this.id = id;
147         }
148         
149         public String getDescription() {
150                 return this.description;
151         }
152
153         public void setDescription(String description) {
154                 this.description = description;
155         }
156         
157         public String getDependency() {
158                 return dependency;
159         }
160
161         public void setDependency(String dependency) {
162                 this.dependency = dependency;
163         }
164         
165         public String getModelName(){
166                 return this.modelName;
167         }
168         
169         public void setModelName(String modelName){
170                 this.modelName = modelName;
171         }
172 }