Initial OpenECOMP policy/engine commit
[policy/engine.git] / ECOMP-REST / src / main / java / org / openecomp / policy / rest / jpa / PolicyScore.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 package org.openecomp.policy.rest.jpa;
22 import java.io.Serializable;
23 import java.util.Date;
24
25 import javax.persistence.Column;
26 import javax.persistence.Entity;
27 import javax.persistence.GeneratedValue;
28 import javax.persistence.GenerationType;
29 import javax.persistence.Id;
30 import javax.persistence.NamedQueries;
31 import javax.persistence.NamedQuery;
32 import javax.persistence.OrderBy;
33 import javax.persistence.PrePersist;
34 import javax.persistence.PreUpdate;
35 import javax.persistence.Table;
36 import javax.persistence.Temporal;
37 import javax.persistence.TemporalType;
38
39
40 @Entity
41 @Table(name="POLICYSCORE")
42 @NamedQueries({
43         @NamedQuery(name="POLICYSCORE.findAll", query="SELECT p FROM PolicyScore p"),
44         @NamedQuery(name="POLICYSCORE.deleteAll", query="DELETE FROM PolicyScore WHERE 1=1"),
45         @NamedQuery(name="POLICYSCORE.findByPolicyName", query="Select p from PolicyScore p where p.PolicyName=:pname")
46 })
47 public class PolicyScore implements Serializable {
48         
49         private static final long serialVersionUID = 1L;
50
51         private static String domain;
52         
53         @Id
54         @GeneratedValue(strategy = GenerationType.AUTO)
55         @Column(name="id")
56         private int id;
57         
58         @Column(name="POLICY_NAME", nullable=false)
59         @OrderBy("asc")
60         private String PolicyName;
61         
62         @Column(name="VERSIONEXTENSION", nullable=false)
63         @OrderBy("asc")
64         private String VersionExtension;
65         
66         @Column(name="POLICY_SCORE", nullable=true)
67         private String PolicyScore;
68         
69         public PolicyScore() {
70                 
71         }
72         
73         public PolicyScore(String pName, String pScore) {
74                 this(domain);
75                 
76         }
77         public PolicyScore(String domain) {
78                 
79         }
80         
81         public int getId() {
82                 return id;
83         }
84
85         public void setId(int id) {
86                 this.id = id;
87         }
88         public String getPolicyName() {
89                 return PolicyName;
90         }
91         public void setPolicyName(String policyName) {
92                 PolicyName = policyName;
93         }
94         public String getVersionExtension() {
95                 return VersionExtension;
96         }
97
98         public void setVersionExtension(String versionExtension) {
99                 VersionExtension = versionExtension;
100         }
101         public String getPolicyScore() {
102                 return PolicyScore;
103         }
104         public void setPolicyScore(String policyScore) {
105                 PolicyScore = policyScore;
106         }
107                 
108
109 }