ramackri commented on code in PR #962:
URL: https://github.com/apache/ranger/pull/962#discussion_r3285655991


##########
security-admin/src/main/java/org/apache/ranger/db/XXResourceDefDao.java:
##########
@@ -101,4 +110,29 @@ public List<XXResourceDef> findByParentResId(Long 
parentId) {
             return new ArrayList<>();
         }
     }
+
+    public Map<String, XXResourceDef> 
findXXResourceDefsByNameAndPolicyId(Set<String> names, Long policyId) {

Review Comment:
   Done



##########
security-admin/src/main/java/org/apache/ranger/db/XXResourceDefDao.java:
##########
@@ -101,4 +110,29 @@ public List<XXResourceDef> findByParentResId(Long 
parentId) {
             return new ArrayList<>();
         }
     }
+
+    public Map<String, XXResourceDef> 
findXXResourceDefsByNameAndPolicyId(Set<String> names, Long policyId) {
+        Map<String, XXResourceDef> ret = Collections.emptyMap();
+        if (policyId == null || CollectionUtils.isEmpty(names)) {
+            return ret;

Review Comment:
   Done



##########
security-admin/src/main/java/org/apache/ranger/db/XXPolicyRefUserDao.java:
##########
@@ -133,4 +135,34 @@ public void deleteByPolicyId(Long policyId) {
 
         batchDeleteByIds("XXPolicyRefUser.deleteByIds", ids, "ids");
     }
+
+    public Map<String, Long> findUserNameIdByPolicyId(Long policyId) {
+        if (policyId == null) {
+            return Collections.emptyMap();
+        }
+        try {
+            List<Object[]> results = getEntityManager()
+                    
.createNamedQuery("XXPolicyRefUser.findUserNameIdByPolicyId", Object[].class)
+                    .setParameter("policyId", policyId)
+                    .getResultList();
+
+            Map<String, Long> userNameIdMap = new HashMap<>();

Review Comment:
   Done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to