2 * ================================================================================
\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
11 * http://www.apache.org/licenses/LICENSE-2.0
\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
20 package org.openecomp.portalapp.portal.domain;
\r
22 import java.io.Serializable;
\r
23 import java.util.Set;
\r
25 import javax.persistence.CascadeType;
\r
26 import javax.persistence.Column;
\r
27 import javax.persistence.FetchType;
\r
28 import javax.persistence.GeneratedValue;
\r
29 import javax.persistence.GenerationType;
\r
30 import javax.persistence.Id;
\r
31 import javax.persistence.JoinColumn;
\r
32 import javax.persistence.ManyToMany;
\r
33 import javax.persistence.ManyToOne;
\r
35 import com.fasterxml.jackson.annotation.JsonIgnore;
\r
38 //@Table(name = "FN_ROLE")
\r
39 public class RoleApp implements Serializable{
\r
40 private static final long serialVersionUID = 1L;
\r
43 //@Column(name = "ROLE_ID")
\r
44 //@GeneratedValue(strategy=GenerationType.AUTO)
\r
45 private Long roleId;
\r
48 //@Column(name = "ROLE_Name")
\r
49 private String roleName;
\r
51 //@ManyToOne(fetch = FetchType.EAGER)
\r
52 //@JoinColumn(name="APP_ID")
\r
56 //@ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, mappedBy="widgetRoles")
\r
57 private Set<WidgetCatalog> widgets;
\r
60 private void removeGroupsFromUsers() {
\r
61 for (WidgetCatalog w : widgets) {
\r
62 w.getWidgetRoles().remove(this);
\r
67 @JoinColumn(name = "WIDGET_ID", nullable = false)
\r
68 WidgetCatalog widgetCatalog;*/
\r
71 //@ManyToMany(mappedBy = "widgetRoles")
\r
72 //@ManyToMany(fetch = FetchType.EAGER, mappedBy = "widgetRoles")
\r
73 //private Set<WidgetCatalog> widgets = new HashSet<WidgetCatalog>();
\r
75 public Long getRoleId() {
\r
79 public void setRoleId(Long roleId) {
\r
80 this.roleId = roleId;
\r
83 public String getRoleName() {
\r
87 public void setRoleName(String roleName) {
\r
88 this.roleName = roleName;
\r
91 public App getApp() {
\r
95 public void setApp(App app) {
\r
101 public Set<WidgetCatalog> getWidgets() {
\r
105 public void setWidgets(Set<WidgetCatalog> widgets) {
\r
106 this.widgets = widgets;
\r
110 public String toString() {
\r
111 return "Role [roleId=" + roleId + ", roleName=" + roleName + ", app=" + app + "]";
\r