- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- @Column(name = "role_id", length = 11, nullable = false)
- @Digits(integer = 11, fraction = 0)
- private Long roleId;
- @Column(name = "role_name", length = 300, nullable = false)
- @Size(max = 300)
- @NotNull
- @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;
- @Column(name = "priority", length = 4, columnDefinition = "decimal(4,0) DEFAULT NULL")
- @Digits(integer = 4, fraction = 0)
- private Long priority;
- @Column(name = "app_Id", length = 11, columnDefinition = "int(11) default null")
- @Digits(integer = 11, fraction = 0)
- private Long appId;
- @Column(name = "app_role_id", length = 11, columnDefinition = "int(11) default null")
- @Digits(integer = 11, fraction = 0)
- private Long appRoleId;
- @OneToMany(
- targetEntity = FnRoleFunction.class,
- mappedBy = "roleId",
- cascade = CascadeType.ALL,
- fetch = FetchType.LAZY
- )
- private List<FnRoleFunction> fnRoleFunctions = new ArrayList<>();
- @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
- @JoinTable(
- name = "fn_user_pseudo_role",
- joinColumns = {@JoinColumn(name = "pseudo_role_Id", referencedColumnName = "role_id")},
- inverseJoinColumns = {@JoinColumn(name = "user_id", referencedColumnName = "user_id")},
- indexes = {
- @Index(name = "fk_pseudo_role_user_id", columnList = "user_id")
- }
- )
- private List<FnUser> fnUsers = new ArrayList<>();
- @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
- @JoinTable(
- name = "fn_role_composite",
- joinColumns = {@JoinColumn(name = "parent_role_id", referencedColumnName = "role_id")},
- inverseJoinColumns = {@JoinColumn(name = "child_role_id", referencedColumnName = "role_id")},
- indexes = {
- @Index(name = "fk_fn_role_composite_child", columnList = "child_role_id")
- }
- )
- private List<FnRole> fnRoles = new ArrayList<>();
- @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
- private List<FnRole> fnRoleList = new ArrayList<>();
- @OneToMany(
- targetEntity = EpRoleNotification.class,
- mappedBy = "notificationID",
- cascade = CascadeType.ALL,
- fetch = FetchType.LAZY
- )
- private List<EpRoleNotification> epRoleNotifications = new ArrayList<>();
- @OneToMany(
- targetEntity = FnMenuFunctionalRoles.class,
- mappedBy = "roleId",
- cascade = CascadeType.ALL,
- fetch = FetchType.LAZY
- )
- private List<FnMenuFunctionalRoles> fnMenuFunctionalRoles = new ArrayList<>();
- @OneToMany(
- targetEntity = EpWidgetCatalogRole.class,
- mappedBy = "roleId",
- cascade = CascadeType.ALL,
- fetch = FetchType.LAZY
- )
- private List<EpWidgetCatalogRole> epWidgetCatalogRoles = new ArrayList<>();
- @OneToMany(
- targetEntity = EpAppRoleFunction.class,
- mappedBy = "fnRole",
- cascade = CascadeType.ALL,
- fetch = FetchType.LAZY
- )
- private List<EpAppRoleFunction> epAppRoleFunctions = new ArrayList<>();
- @OneToMany(
- targetEntity = EpUserRolesRequestDet.class,
- mappedBy = "requestedRoleId",
- cascade = CascadeType.ALL,
- fetch = FetchType.LAZY
- )
- private List<EpUserRolesRequestDet> epUserRolesRequestDets = new ArrayList<>();
- @OneToMany(
- targetEntity = FnUserRole.class,
- mappedBy = "roleId",
- cascade = CascadeType.ALL,
- fetch = FetchType.LAZY
- )
- private List<FnUserRole> fnUserRoles = new ArrayList<>();
+ @Id
+ @GeneratedValue(strategy = GenerationType.AUTO)
+ @Column(name = "role_id", length = 11, nullable = false)
+ @Digits(integer = 11, fraction = 0)
+ private Long roleId;
+ @Column(name = "role_name", length = 300, nullable = false)
+ @Size(max = 300)
+ @NotNull
+ @SafeHtml
+ private String roleName;
+ @Column(name = "active_yn", length = 1, columnDefinition = "character varying(1) default 'y'", nullable = false)
+ @NotNull
+ private Boolean activeYn;
+ @Column(name = "priority", length = 4, columnDefinition = "decimal(4,0) DEFAULT NULL")
+ @Digits(integer = 4, fraction = 0)
+ private Integer priority;
+ @Column(name = "app_Id", length = 11, columnDefinition = "int(11) default null")
+ @Digits(integer = 11, fraction = 0)
+ private Long appId;
+ @Column(name = "app_role_id", length = 11, columnDefinition = "int(11) default null")
+ @Digits(integer = 11, fraction = 0)
+ private Long appRoleId;
+ @OneToMany(
+ targetEntity = FnRoleFunction.class,
+ mappedBy = "roleId",
+ cascade = CascadeType.ALL,
+ fetch = FetchType.LAZY
+ )
+ private Set<FnRoleFunction> fnRoleFunctions;
+ @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
+ @JoinTable(
+ name = "fn_user_pseudo_role",
+ joinColumns = {@JoinColumn(name = "pseudo_role_Id", referencedColumnName = "role_id")},
+ inverseJoinColumns = {@JoinColumn(name = "user_id", referencedColumnName = "user_id")},
+ indexes = {
+ @Index(name = "fk_pseudo_role_user_id", columnList = "user_id")
+ }
+ )
+ private Set<FnUser> fnUsers;
+ @OneToMany(
+ targetEntity = FnRoleComposite.class,
+ mappedBy = "childRoles",
+ cascade = CascadeType.ALL,
+ fetch = FetchType.LAZY
+ )
+ private Set<FnRoleComposite> childRoles;
+ @OneToMany(
+ targetEntity = FnRoleComposite.class,
+ mappedBy = "parentRoles",
+ cascade = CascadeType.ALL,
+ fetch = FetchType.LAZY
+ )
+ private Set<FnRoleComposite> parentRoles;
+ @ManyToMany(cascade = CascadeType.ALL,
+ fetch = FetchType.LAZY)
+ private Set<FnRoleFunction> roleFunctions;
+ @OneToMany(
+ targetEntity = EpRoleNotification.class,
+ mappedBy = "notificationID",
+ cascade = CascadeType.ALL,
+ fetch = FetchType.LAZY
+ )
+ private Set<EpRoleNotification> epRoleNotifications;
+ @OneToMany(
+ targetEntity = FnMenuFunctionalRoles.class,
+ mappedBy = "roleId",
+ cascade = CascadeType.ALL,
+ fetch = FetchType.LAZY
+ )
+ private Set<FnMenuFunctionalRoles> fnMenuFunctionalRoles;
+ @OneToMany(
+ targetEntity = EpWidgetCatalogRole.class,
+ mappedBy = "roleId",
+ cascade = CascadeType.ALL,
+ fetch = FetchType.LAZY
+ )
+ private Set<EpWidgetCatalogRole> epWidgetCatalogRoles;
+ @OneToMany(
+ targetEntity = EpAppRoleFunction.class,
+ mappedBy = "fnRole",
+ cascade = CascadeType.ALL,
+ fetch = FetchType.LAZY
+ )
+ private Set<EpAppRoleFunction> epAppRoleFunctions;
+ @OneToMany(
+ targetEntity = EpUserRolesRequestDet.class,
+ mappedBy = "requestedRoleId",
+ cascade = CascadeType.ALL,
+ fetch = FetchType.LAZY
+ )
+ private Set<EpUserRolesRequestDet> epUserRolesRequestDets;
+ @OneToMany(
+ targetEntity = FnUserRole.class,
+ mappedBy = "roleId",
+ cascade = CascadeType.ALL,
+ fetch = FetchType.LAZY
+ )
+ private Set<FnUserRole> fnUserRoles;
+
+ public FnRole(Long roleId, String roleName, Boolean activeYn, Integer priority,
+ Set<FnRoleFunction> fnRoleFunctions, Set<FnRoleComposite> childRoles,
+ Set<FnRoleComposite> parentRoles) {
+ this.roleId = roleId;
+ this.roleName = roleName;
+ this.activeYn = activeYn;
+ this.priority = priority;
+ this.fnRoleFunctions = fnRoleFunctions;
+ this.childRoles = childRoles;
+ this.parentRoles = parentRoles;
+ }