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