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;fp=portal-BE%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fportal%2Fdomain%2Fdb%2Ffn%2FFnRole.java;h=ff03199aac042c22ee2fb7a7fce8f708a4cfef11;hb=ca3d9f4b725774763f12488940033a294b778244;hp=6bb13d708a9b8a0ea2f083d8f50743e53031ff9c;hpb=4c6f6a443cb2e6effa995e77d56689c1c2dab4ad;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 6bb13d70..ff03199a 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 @@ -55,6 +55,8 @@ import javax.persistence.Index; import javax.persistence.JoinColumn; import javax.persistence.JoinTable; import javax.persistence.ManyToMany; +import javax.persistence.NamedNativeQueries; +import javax.persistence.NamedNativeQuery; import javax.persistence.NamedQueries; import javax.persistence.NamedQuery; import javax.persistence.OneToMany; @@ -113,6 +115,9 @@ CREATE TABLE `fn_role` ( @NamedQuery( name = "FnRole.retrieveActiveRolesOfApplication", query = "from FnRole where activeYn = 'Y' and appId=:appId"), + @NamedQuery( + name = "FnRole.retrieveActiveRolesWhereAppIdIsNull", + query = "from FnRole where activeYn = 'Y' and appId is null"), @NamedQuery( name = "FnRole.getUserRoleOnUserIdAndAppId", query = " FROM" @@ -137,6 +142,13 @@ CREATE TABLE `fn_role` ( ) }) +@NamedNativeQuery( + name = "FnRole.userAppGlobalRoles", + query = "select fr.role_id , fr.role_name ,fr.active_yn, fr.priority, fr.app_id, fr.app_role_id \n" + + " from fn_user_role a, fn_role fr, fn_user fu \n" + + " where a.role_id in (select b.role_id from ep_app_role_function b where b.role_app_id = 1 and b.app_id =:appId) and a.user_id =fu.user_id and a.role_id = fr.role_id and fr.active_yn='Y' and fu.active_yn='Y' and fu.user_id =:userId\n" +) + @Table(name = "fn_role") @NoArgsConstructor @Getter