X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=portal-BE%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportal%2Fdomain%2Fdb%2Ffn%2FFnRole.java;h=57d9079702f844c3982130a8998c071a42a18515;hb=0dd6f1189815079526c3f5211f01650bbe5e665b;hp=dc4578832323076f5316fdc524b95bb1116fca66;hpb=7ce177cd99096772ff42ef89d8820070c687fd9b;p=portal.git diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRole.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRole.java index dc457883..57d90797 100644 --- a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRole.java +++ b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnRole.java @@ -40,8 +40,8 @@ package org.onap.portal.domain.db.fn; -import java.util.ArrayList; -import java.util.List; +import java.io.Serializable; +import java.util.Set; import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; @@ -70,6 +70,7 @@ import org.onap.portal.domain.db.ep.EpAppRoleFunction; import org.onap.portal.domain.db.ep.EpRoleNotification; import org.onap.portal.domain.db.ep.EpUserRolesRequestDet; import org.onap.portal.domain.db.ep.EpWidgetCatalogRole; +import org.onap.portal.domain.dto.DomainVo; /* CREATE TABLE `fn_role` ( @@ -121,7 +122,7 @@ CREATE TABLE `fn_role` ( @Getter @Setter @Entity -public class FnRole { +public class FnRole extends DomainVo implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) @@ -134,11 +135,8 @@ public class FnRole { @SafeHtml private String roleName; @Column(name = "active_yn", length = 1, columnDefinition = "character varying(1) default 'y'", nullable = false) - @Pattern(regexp = "[YNyn]") - @Size(max = 1) @NotNull - @SafeHtml - private String activeYn; + private Boolean activeYn; @Column(name = "priority", length = 4, columnDefinition = "decimal(4,0) DEFAULT NULL") @Digits(integer = 4, fraction = 0) private Long priority; @@ -154,7 +152,7 @@ public class FnRole { cascade = CascadeType.ALL, fetch = FetchType.LAZY ) - private List fnRoleFunctions = new ArrayList<>(); + private Set fnRoleFunctions; @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JoinTable( name = "fn_user_pseudo_role", @@ -164,7 +162,7 @@ public class FnRole { @Index(name = "fk_pseudo_role_user_id", columnList = "user_id") } ) - private List fnUsers = new ArrayList<>(); + private Set fnUsers; @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) @JoinTable( name = "fn_role_composite", @@ -174,49 +172,50 @@ public class FnRole { @Index(name = "fk_fn_role_composite_child", columnList = "child_role_id") } ) - private List fnRoles = new ArrayList<>(); - @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY) - private List fnRoleList = new ArrayList<>(); + private Set fnRoles; + @ManyToMany(cascade = CascadeType.ALL, + fetch = FetchType.LAZY) + private Set fnRoleList; @OneToMany( targetEntity = EpRoleNotification.class, mappedBy = "notificationID", cascade = CascadeType.ALL, fetch = FetchType.LAZY ) - private List epRoleNotifications = new ArrayList<>(); + private Set epRoleNotifications; @OneToMany( targetEntity = FnMenuFunctionalRoles.class, mappedBy = "roleId", cascade = CascadeType.ALL, fetch = FetchType.LAZY ) - private List fnMenuFunctionalRoles = new ArrayList<>(); + private Set fnMenuFunctionalRoles; @OneToMany( targetEntity = EpWidgetCatalogRole.class, mappedBy = "roleId", cascade = CascadeType.ALL, fetch = FetchType.LAZY ) - private List epWidgetCatalogRoles = new ArrayList<>(); + private Set epWidgetCatalogRoles; @OneToMany( targetEntity = EpAppRoleFunction.class, mappedBy = "fnRole", cascade = CascadeType.ALL, fetch = FetchType.LAZY ) - private List epAppRoleFunctions = new ArrayList<>(); + private Set epAppRoleFunctions; @OneToMany( targetEntity = EpUserRolesRequestDet.class, mappedBy = "requestedRoleId", cascade = CascadeType.ALL, fetch = FetchType.LAZY ) - private List epUserRolesRequestDets = new ArrayList<>(); + private Set epUserRolesRequestDets; @OneToMany( targetEntity = FnUserRole.class, mappedBy = "roleId", cascade = CascadeType.ALL, fetch = FetchType.LAZY ) - private List fnUserRoles = new ArrayList<>(); + private Set fnUserRoles; }