[PORTAL-16 PORTAL-18] Widget ms; staging
[portal.git] / ecomp-portal-BE-common / src / main / java / org / openecomp / portalapp / portal / transport / FunctionalMenuRole.java
1 /*-
2  * ================================================================================
3  * ECOMP Portal
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property
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  * ================================================================================
19  */
20 package org.openecomp.portalapp.portal.transport;
21 import java.io.Serializable;
22
23 import javax.persistence.Column;
24 import javax.persistence.Entity;
25 import javax.persistence.GeneratedValue;
26 import javax.persistence.GenerationType;
27 import javax.persistence.Id;
28 import javax.persistence.Table;
29
30 @Entity
31 @Table(name="fn_menu_functional_roles")
32 public class FunctionalMenuRole implements Serializable {
33         private static final long serialVersionUID = 1L;
34
35         @Id
36     @GeneratedValue(strategy=GenerationType.IDENTITY)
37         @Column(name = "ID")
38         public Integer id;
39         
40         @Column(name = "MENU_ID")
41         public Long menuId;
42         
43         @Column(name = "APP_ID")
44         public Integer appId;
45         
46         @Column(name = "ROLE_ID")
47         public Integer roleId;
48
49         public Integer getId() {
50                 return id;
51         }
52
53         public void setId(Integer id) {
54                 this.id = id;
55         }
56
57         public Long getMenuId() {
58                 return menuId;
59         }
60
61         public void setMenuId(Long menuId) {
62                 this.menuId = menuId;
63         }
64
65         public Integer getAppId() {
66                 return appId;
67         }
68
69         public void setAppId(Integer appId) {
70                 this.appId = appId;
71         }
72
73         public Integer getRoleId() {
74                 return roleId;
75         }
76
77         public void setRoleId(Integer roleId) {
78                 this.roleId = roleId;
79         }
80
81         @Override
82         public String toString() {
83                 return "FunctionalMenuRole [id=" + id + ", menuId=" + menuId + ", appId=" + appId + ", roleId=" + roleId + "]";
84         }
85
86         @Override
87         public int hashCode() {
88                 final int prime = 31;
89                 int result = 1;
90                 result = prime * result + ((appId == null) ? 0 : appId.hashCode());
91                 result = prime * result + ((id == null) ? 0 : id.hashCode());
92                 result = prime * result + ((menuId == null) ? 0 : menuId.hashCode());
93                 result = prime * result + ((roleId == null) ? 0 : roleId.hashCode());
94                 return result;
95         }
96
97         @Override
98     public boolean equals(Object o) {
99
100         if (o == this) return true;
101         if (!(o instanceof FunctionalMenuRole)) {
102             return false;
103         }
104         FunctionalMenuRole functionalMenuRole = (FunctionalMenuRole) o;
105         System.out.println("test");
106         return  id.equals(functionalMenuRole.getId()) &&
107                         menuId.equals(functionalMenuRole.menuId) &&
108                         appId.equals(functionalMenuRole.appId) &&
109                         roleId.equals(functionalMenuRole.roleId) ;
110     }
111         
112         
113         
114         
115 }