diff options
Diffstat (limited to 'portal-BE/src/main/java/org/onap/portal/domain/db')
-rw-r--r-- | portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserWidgetSel.java | 2 | ||||
-rw-r--r-- | portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUserRole.java | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserWidgetSel.java b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserWidgetSel.java index 9cee72a3..4b2785f1 100644 --- a/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserWidgetSel.java +++ b/portal-BE/src/main/java/org/onap/portal/domain/db/ep/EpPersUserWidgetSel.java @@ -82,7 +82,7 @@ CREATE TABLE `ep_pers_user_widget_sel` ( @NamedQueries({ @NamedQuery( name = "EpPersUserWidgetSel.getEpPersUserWidgetSelForUserIdAndWidgetId", - query = "FROM EpPersUserWidgetSel WHERE userId = :USERID and widgetId = :WIDGETID") + query = "FROM EpPersUserWidgetSel WHERE userId.userId = :USERID and widgetId.widgetId = :WIDGETID") }) @Table(name = "ep_pers_user_widget_sel", uniqueConstraints = { @UniqueConstraint(columnNames = {"user_id", "widget_id"}) diff --git a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUserRole.java b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUserRole.java index 390ef8b4..4e783764 100644 --- a/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUserRole.java +++ b/portal-BE/src/main/java/org/onap/portal/domain/db/fn/FnUserRole.java @@ -53,6 +53,8 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.NamedNativeQueries; import javax.persistence.NamedNativeQuery; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; import javax.persistence.OneToOne; import javax.persistence.Table; import javax.persistence.UniqueConstraint; @@ -82,16 +84,25 @@ CREATE TABLE `fn_user_role` ( @NamedNativeQueries({ @NamedNativeQuery( name = "FnUserRole.retrieveUserRoleOnUserIdAndRoleIdAndAppId", - query = "select * from FnUserRole where user_id= :userId" + query = "FROM FnUserRole where user_id= :userId" + " and role_id= :roleId" + " and app_id= :appId"), @NamedNativeQuery( name = "FnUserRole.retrieveCachedAppRolesForUser", - query = "select * from FnUserRole where user_id= :userId" + query = "FROM FnUserRole where user_id= :userId" + " and user_id= :userId" + " and app_id= :appId") }) +@NamedQueries({ + @NamedQuery( + name = "FnUserRole.getAdminUserRoles", + query = "FROM FnUserRole fn " + + "WHERE fn.userId.userId = :USERID " + + "AND fn.roleId.roleId = :ROLEID " + + "AND fn.appId.appId = :APPID") +}) + @Table( name = "fn_user_role", indexes = { |