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