0f4a6b4fa1dd254f4463cf8d6e4d683a8709bdcd
[portal.git] / ecomp-portal-BE-common / src / main / java / org / onap / portalapp / portal / transport / FunctionalMenuRole.java
1 /*-
2  * ============LICENSE_START==========================================
3  * ONAP Portal
4  * ===================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ===================================================================
7  *
8  * Unless otherwise specified, all software contained herein is licensed
9  * under the Apache License, Version 2.0 (the "License");
10  * you may not use this software except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *             http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * Unless otherwise specified, all documentation contained herein is licensed
22  * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
23  * you may not use this documentation except in compliance with the License.
24  * You may obtain a copy of the License at
25  *
26  *             https://creativecommons.org/licenses/by/4.0/
27  *
28  * Unless required by applicable law or agreed to in writing, documentation
29  * distributed under the License is distributed on an "AS IS" BASIS,
30  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31  * See the License for the specific language governing permissions and
32  * limitations under the License.
33  *
34  * ============LICENSE_END============================================
35  *
36  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
37  */
38 package org.onap.portalapp.portal.transport;
39 import java.io.Serializable;
40
41 import javax.persistence.Column;
42 import javax.persistence.Entity;
43 import javax.persistence.GeneratedValue;
44 import javax.persistence.GenerationType;
45 import javax.persistence.Id;
46 import javax.persistence.Table;
47
48 @Entity
49 @Table(name="fn_menu_functional_roles")
50 public class FunctionalMenuRole implements Serializable {
51         private static final long serialVersionUID = 1L;
52
53         @Id
54     @GeneratedValue(strategy=GenerationType.IDENTITY)
55         @Column(name = "ID")
56         public Integer id;
57         
58         @Column(name = "MENU_ID")
59         public Long menuId;
60         
61         @Column(name = "APP_ID")
62         public Integer appId;
63         
64         @Column(name = "ROLE_ID")
65         public Integer roleId;
66
67         public Integer getId() {
68                 return id;
69         }
70
71         public void setId(Integer id) {
72                 this.id = id;
73         }
74
75         public Long getMenuId() {
76                 return menuId;
77         }
78
79         public void setMenuId(Long menuId) {
80                 this.menuId = menuId;
81         }
82
83         public Integer getAppId() {
84                 return appId;
85         }
86
87         public void setAppId(Integer appId) {
88                 this.appId = appId;
89         }
90
91         public Integer getRoleId() {
92                 return roleId;
93         }
94
95         public void setRoleId(Integer roleId) {
96                 this.roleId = roleId;
97         }
98
99         @Override
100         public String toString() {
101                 return "FunctionalMenuRole [id=" + id + ", menuId=" + menuId + ", appId=" + appId + ", roleId=" + roleId + "]";
102         }
103
104         @Override
105         public int hashCode() {
106                 final int prime = 31;
107                 int result = 1;
108                 result = prime * result + ((appId == null) ? 0 : appId.hashCode());
109                 result = prime * result + ((id == null) ? 0 : id.hashCode());
110                 result = prime * result + ((menuId == null) ? 0 : menuId.hashCode());
111                 result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
112                 return result;
113         }
114
115         @Override
116     public boolean equals(Object o) {
117
118         if (o == this) return true;
119         if (!(o instanceof FunctionalMenuRole)) {
120             return false;
121         }
122         FunctionalMenuRole functionalMenuRole = (FunctionalMenuRole) o;
123         System.out.println("test");
124         return  id.equals(functionalMenuRole.getId()) &&
125                         menuId.equals(functionalMenuRole.menuId) &&
126                         appId.equals(functionalMenuRole.appId) &&
127                         roleId.equals(functionalMenuRole.roleId) ;
128     }
129         
130         
131         
132         
133 }