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