-/*-\r
- * ================================================================================\r
- * ECOMP Portal\r
- * ================================================================================\r
- * Copyright (C) 2017 AT&T Intellectual Property\r
- * ================================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- * \r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- * \r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- * ================================================================================\r
- */\r
-package org.openecomp.portalapp.portal.domain;\r
-\r
-import java.io.Serializable;\r
-import java.util.Set;\r
-\r
-import javax.persistence.CascadeType;\r
-import javax.persistence.Column;\r
-import javax.persistence.FetchType;\r
-import javax.persistence.GeneratedValue;\r
-import javax.persistence.GenerationType;\r
-import javax.persistence.Id;\r
-import javax.persistence.JoinColumn;\r
-import javax.persistence.ManyToMany;\r
-import javax.persistence.ManyToOne;\r
-\r
-import com.fasterxml.jackson.annotation.JsonIgnore;\r
-\r
-//@Entity\r
-//@Table(name = "FN_ROLE")\r
-public class RoleApp implements Serializable{\r
- private static final long serialVersionUID = 1L;\r
-\r
- //@Id\r
- //@Column(name = "ROLE_ID")\r
- //@GeneratedValue(strategy=GenerationType.AUTO)\r
- private Long roleId;\r
- \r
- \r
- //@Column(name = "ROLE_Name")\r
- private String roleName;\r
- \r
- //@ManyToOne(fetch = FetchType.EAGER)\r
- //@JoinColumn(name="APP_ID")\r
- private App app;\r
- \r
- //@JsonIgnore\r
- //@ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, mappedBy="widgetRoles")\r
- private Set<WidgetCatalog> widgets;\r
-\r
- /*@PreRemove\r
- private void removeGroupsFromUsers() {\r
- for (WidgetCatalog w : widgets) {\r
- w.getWidgetRoles().remove(this);\r
- }\r
- }*/\r
- \r
- /*@ManyToOne\r
- @JoinColumn(name = "WIDGET_ID", nullable = false)\r
- WidgetCatalog widgetCatalog;*/\r
-\r
- //@JsonIgnore\r
- //@ManyToMany(mappedBy = "widgetRoles")\r
- //@ManyToMany(fetch = FetchType.EAGER, mappedBy = "widgetRoles")\r
- //private Set<WidgetCatalog> widgets = new HashSet<WidgetCatalog>();\r
- \r
- public Long getRoleId() {\r
- return roleId;\r
- }\r
-\r
- public void setRoleId(Long roleId) {\r
- this.roleId = roleId;\r
- }\r
-\r
- public String getRoleName() {\r
- return roleName;\r
- }\r
-\r
- public void setRoleName(String roleName) {\r
- this.roleName = roleName;\r
- }\r
-\r
- public App getApp() {\r
- return app;\r
- }\r
-\r
- public void setApp(App app) {\r
- this.app = app;\r
- }\r
- \r
- \r
-\r
- public Set<WidgetCatalog> getWidgets() {\r
- return widgets;\r
- }\r
-\r
- public void setWidgets(Set<WidgetCatalog> widgets) {\r
- this.widgets = widgets;\r
- }\r
-\r
- @Override\r
- public String toString() {\r
- return "Role [roleId=" + roleId + ", roleName=" + roleName + ", app=" + app + "]";\r
- }\r
- \r
-}\r
+/*-
+ * ================================================================================
+ * ECOMP Portal
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ================================================================================
+ */
+package org.openecomp.portalapp.portal.domain;
+
+import java.io.Serializable;
+import java.util.Set;
+
+import javax.persistence.CascadeType;
+import javax.persistence.Column;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.GenerationType;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+//@Entity
+//@Table(name = "FN_ROLE")
+public class RoleApp implements Serializable{
+ private static final long serialVersionUID = 1L;
+
+ //@Id
+ //@Column(name = "ROLE_ID")
+ //@GeneratedValue(strategy=GenerationType.AUTO)
+ private Long roleId;
+
+
+ //@Column(name = "ROLE_Name")
+ private String roleName;
+
+ //@ManyToOne(fetch = FetchType.EAGER)
+ //@JoinColumn(name="APP_ID")
+ private App app;
+
+ //@JsonIgnore
+ //@ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH}, mappedBy="widgetRoles")
+ private Set<WidgetCatalog> widgets;
+
+ /*@PreRemove
+ private void removeGroupsFromUsers() {
+ for (WidgetCatalog w : widgets) {
+ w.getWidgetRoles().remove(this);
+ }
+ }*/
+
+ /*@ManyToOne
+ @JoinColumn(name = "WIDGET_ID", nullable = false)
+ WidgetCatalog widgetCatalog;*/
+
+ //@JsonIgnore
+ //@ManyToMany(mappedBy = "widgetRoles")
+ //@ManyToMany(fetch = FetchType.EAGER, mappedBy = "widgetRoles")
+ //private Set<WidgetCatalog> widgets = new HashSet<WidgetCatalog>();
+
+ public Long getRoleId() {
+ return roleId;
+ }
+
+ public void setRoleId(Long roleId) {
+ this.roleId = roleId;
+ }
+
+ public String getRoleName() {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName) {
+ this.roleName = roleName;
+ }
+
+ public App getApp() {
+ return app;
+ }
+
+ public void setApp(App app) {
+ this.app = app;
+ }
+
+
+
+ public Set<WidgetCatalog> getWidgets() {
+ return widgets;
+ }
+
+ public void setWidgets(Set<WidgetCatalog> widgets) {
+ this.widgets = widgets;
+ }
+
+ @Override
+ public String toString() {
+ return "Role [roleId=" + roleId + ", roleName=" + roleName + ", app=" + app + "]";
+ }
+
+}