diff options
author | 2018-01-30 17:29:36 -0500 | |
---|---|---|
committer | 2018-02-01 15:10:02 -0500 | |
commit | 21a8761f684745bb300e075c7e98ad897ace9eed (patch) | |
tree | 6d585c3fe39fbb42a314941dbc8646e6ccf188cf /ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java | |
parent | 3af8af1310d5a27cb58be29505573f0bbdc1717c (diff) |
Security/ Package Name changes
Issue-ID: PORTAL-174, PORTAL-157, PORTAL-156, PORTAL-148, PORTAL-145,
PORTAL-140, PORTAL-133, PORTAL-121, PORTAL-111, PORTAL-88
Includes security fixes, Role Centralization, replace certain ECOMP
occurrences etc
Change-Id: I3c8b706709c6b92e646e3cbe50c2d660e8a46ef4
Signed-off-by: st782s <statta@research.att.com>
Diffstat (limited to 'ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java')
-rw-r--r-- | ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java new file mode 100644 index 00000000..807067b2 --- /dev/null +++ b/ecomp-portal-widget-ms/widget-ms/src/main/java/org/onap/portalapp/widget/domain/RoleApp.java @@ -0,0 +1,95 @@ +package org.onap.portalapp.widget.domain; + +import java.io.Serializable; +import java.util.Set; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +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 javax.persistence.Table; + +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 "RoleApp [roleId=" + roleId + ", roleName=" + roleName + ", app=" + app + "]"; + } + +} |