Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2012 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.opensource.org/licenses/ecl2.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.kuali.rice.kim.impl.role;
 
 
 import java.util.List;
 import java.util.Map;
 
 import static org.kuali.rice.core.api.criteria.PredicateFactory.*;
 
 public class RoleDaoOjb extends PlatformAwareDaoBaseOjb implements RoleDao {
    
Adds SubCriteria to the Query Criteria using the role qualification passed in

Parameters:
c The Query Criteria object to be used
qualification The role qualification
 
     private void addSubCriteriaBasedOnRoleQualification(Criteria cMap<StringStringqualification) {
         if (qualification != null && CollectionUtils.isNotEmpty(qualification.keySet())) {
             for (Map.Entry<StringStringqualifier : qualification.entrySet()) {
                 Criteria subCrit = new Criteria();
                 if (StringUtils.isNotEmpty(qualifier.getValue())) {
                     String value = (qualifier.getValue()).replace('*''%');
                     subCrit.addLike("attributeValue"value);
                     subCrit.addEqualTo("kimAttributeId"qualifier.getKey());
                     subCrit.addEqualToField("assignedToId". + "id");
                     ReportQueryByCriteria subQuery = QueryFactory.newReportQuery(RoleMemberAttributeDataBo.classsubCrit);
                     c.addExists(subQuery);
                 }
             }
         }
     }
 
     @SuppressWarnings("unchecked")
     public List<RoleMemberBogetRolePrincipalsForPrincipalIdAndRoleIds(Collection<StringroleIdsString principalIdMap<StringStringqualification) {
 
         Criteria c = new Criteria();
 
         if (roleIds != null) {
             c.addIn(..roleIds);
         }
         if (principalId != null) {
             c.addEqualTo(..principalId);
         }
         addSubCriteriaBasedOnRoleQualification(cqualification);
 
         Query query = QueryFactory.newQuery(RoleMemberBo.classc);
         ArrayList<RoleMemberBoresults = new ArrayList<RoleMemberBo>(coll.size());
         for (RoleMemberBo rm : coll) {
             if (rm.isActive(new Timestamp(System.currentTimeMillis()))) {
                 results.add(rm);
             }
        }
        return results;
    }
        List<StringgroupIdValues = new ArrayList<String>();
        List<GroupMembergroupPrincipals = new ArrayList<GroupMember>();
        if (groupIds != null
                && principalId == null) {
            groupIdValues = new ArrayList<String>(groupIds);
        } else if (principalId != null) {
            groupIdValues = KimApiServiceLocator.getGroupService().getGroupIdsByPrincipalId(principalId);
        }
        if (groupIdValues != null
                && groupIdValues.size() > 0) {
            Collection<GroupMembergroupMembers = KimApiServiceLocator.getGroupService().getMembers(groupIdValues);
            for (GroupMember groupMembershipInfo : groupMembers) {
                if (principalId != null) {
                    if (..equals(groupMembershipInfo.getType())
                            && StringUtils.equals(principalIdgroupMembershipInfo.getMemberId())
                            && groupMembershipInfo.isActive(new DateTime())) {
                        groupPrincipals.add(groupMembershipInfo);
                    }
                } else {
                    groupPrincipals.add(groupMembershipInfo);
                }
            }
        }
        return groupPrincipals;
    }
    public List<GroupMembergetGroupMembers(Collection<StringgroupIds) {
        List<GroupMembergroupMembers = new ArrayList<GroupMember>();
        if (groupIds != null) {
            List<StringgroupIdValues = new ArrayList<String>(groupIds);
            if (groupIdValues.size() > 0) {
                Collection<GroupMembergroupMemberships = KimApiServiceLocator.getGroupService().getMembers(groupIdValues);
                if (!CollectionUtils.isEmpty(groupMemberships)) {
                    for (GroupMember groupMembershipInfo : groupMemberships) {
                        if (..equals(groupMembershipInfo.getType())
                                && groupMembershipInfo.isActive(new DateTime())) {
                            groupMembers.add(groupMembershipInfo);
                        }
                    }
                }
            }
        }
        return groupMembers;
    }
    @SuppressWarnings("unchecked")
    public List<RoleMemberBogetRoleGroupsForGroupIdsAndRoleIds(Collection<StringroleIdsCollection<StringgroupIdsMap<StringStringqualification) {
        Criteria c = new Criteria();
        if (roleIds != null && !roleIds.isEmpty()) {
            c.addIn(..roleIds);
        }
        if (groupIds != null && !groupIds.isEmpty()) {
            c.addIn(..groupIds);
        }
        addSubCriteriaBasedOnRoleQualification(cqualification);
        Query query = QueryFactory.newQuery(RoleMemberBo.classc);
        ArrayList<RoleMemberBoresults = new ArrayList<RoleMemberBo>(coll.size());
        for (RoleMemberBo rm : coll) {
            if (rm.isActive(new Timestamp(System.currentTimeMillis()))) {
                results.add(rm);
            }
        }
        return results;
    }
    @SuppressWarnings("unchecked")
        Map<StringDelegateTypeBoresults = new HashMap<StringDelegateTypeBo>();
        if (CollectionUtils.isNotEmpty(roleIds)) {
            Criteria c = new Criteria();
            c.addIn(..roleIds);
            Query query = QueryFactory.newQuery(DelegateTypeBo.classc);
            for (DelegateTypeBo delegateBo : coll) {
                results.put(delegateBo.getDelegationId(), delegateBo);
            }
        }
        return results;
    }
    @SuppressWarnings("unchecked")
        List<DelegateTypeBoresults = new ArrayList<DelegateTypeBo>();
        if (roleIds != null && !roleIds.isEmpty()) {
            Criteria c = new Criteria();
            c.addIn(..roleIds);
            Query query = QueryFactory.newQuery(DelegateTypeBo.classc);
            for (DelegateTypeBo delegateBo : coll) {
                results.add(delegateBo);
            }
        }
        return results;
    }
    @SuppressWarnings("unchecked")
            Collection<StringdelegationIdsString principalId) {
        Criteria c = new Criteria();
        if (principalId != null) {
            c.addEqualTo(..principalId);
        }
        if (delegationIds != null && !delegationIds.isEmpty()) {
            c.addIn(..delegationIds);
        }
        Query query = QueryFactory.newQuery(DelegateMemberBo.classc);
        ArrayList<DelegateMemberBoresults = new ArrayList<DelegateMemberBo>(coll.size());
        for (DelegateMemberBo rm : coll) {
            if (rm.isActive(new Timestamp(System.currentTimeMillis()))) {
                results.add(rm);
            }
        }
        return results;
    }
    @SuppressWarnings("unchecked")
            Collection<StringdelegationIdsList<StringgroupIds) {
        Criteria c = new Criteria();
        if (delegationIds != null && !delegationIds.isEmpty()) {
            c.addIn(..delegationIds);
        }
        if (groupIds != null && !groupIds.isEmpty()) {
            c.addIn(..groupIds);
        }
        Query query = QueryFactory.newQuery(DelegateMemberBo.classc);
        ArrayList<DelegateMemberBoresults = new ArrayList<DelegateMemberBo>(coll.size());
        for (DelegateMemberBo rm : coll) {
            if (rm.isActive(new Timestamp(System.currentTimeMillis()))) {
                results.add(rm);
            }
        }
        return results;
    }
    @SuppressWarnings("unchecked")
    public List<RoleMemberBogetRoleMembersForRoleIds(Collection<StringroleIdsString memberTypeCodeMap<StringStringqualification) {
        Criteria c = new Criteria();
        if (roleIds != null && !roleIds.isEmpty()) {
            c.addIn(..roleIds);
        }
        if (memberTypeCode != null) {
            c.addEqualTo(..memberTypeCode);
        }
        addSubCriteriaBasedOnRoleQualification(cqualification);
        Query query = QueryFactory.newQuery(RoleMemberBo.classc);
        ArrayList<RoleMemberBoresults = new ArrayList<RoleMemberBo>(coll.size());
        for (RoleMemberBo rm : coll) {
            if (rm.isActive(new Timestamp(System.currentTimeMillis()))) {
                results.add(rm);
            }
        }
        return results;
    }
    @SuppressWarnings("unchecked")
    public List<RoleMemberBogetRoleMembershipsForRoleIdsAsMembers(Collection<StringroleIdsMap<StringStringqualification) {
        Criteria c = new Criteria();
        if (roleIds != null && !roleIds.isEmpty()) {
            c.addIn(..roleIds);
        }
        addSubCriteriaBasedOnRoleQualification(cqualification);
        Query query = QueryFactory.newQuery(RoleMemberBo.classc);
        ArrayList<RoleMemberBoresults = new ArrayList<RoleMemberBo>(coll.size());
        for (RoleMemberBo rm : coll) {
            if (rm.isActive(new Timestamp(System.currentTimeMillis()))) {
                results.add(rm);
            }
        }
        return results;
    }
    @SuppressWarnings("unchecked")
    public List<RoleMemberBogetRoleMembershipsForMemberId(String memberTypeString memberIdMap<StringStringqualification) {
        Criteria c = new Criteria();
        List<RoleMemberBoparentRoleMembers = new ArrayList<RoleMemberBo>();
        if (StringUtils.isEmpty(memberId)
                || StringUtils.isEmpty(memberType)) {
            return parentRoleMembers;
        }
        addSubCriteriaBasedOnRoleQualification(cqualification);
        Query query = QueryFactory.newQuery(RoleMemberBo.classc);
        ArrayList<RoleMemberBoresults = new ArrayList<RoleMemberBo>(coll.size());
        for (RoleMemberBo rm : coll) {
            if (rm.isActive(new Timestamp(System.currentTimeMillis()))) {
                results.add(rm);
            }
        }
        return results;
    }
    @SuppressWarnings("unchecked")
    public List<RoleMemberBogetRoleMembersForRoleIdsWithFilters(Collection<StringroleIdsString principalIdCollection<StringgroupIdsMap<StringStringqualification) {
        Criteria c = new Criteria();
        if (roleIds != null && !roleIds.isEmpty()) {
            c.addIn(..roleIds);
        }
        Criteria orSet = new Criteria();
        Criteria principalCheck = new Criteria();
        if (principalId != null) {
            principalCheck.addEqualTo(..principalId);
        }
        orSet.addOrCriteria(principalCheck);
        Criteria groupCheck = new Criteria();
        if (groupIds != null && !groupIds.isEmpty()) {
            groupCheck.addIn(..groupIds);
        }
        orSet.addOrCriteria(groupCheck);
        c.addAndCriteria(orSet);
        addSubCriteriaBasedOnRoleQualification(cqualification);
        Query query = QueryFactory.newQuery(RoleMemberBo.classc);
        ArrayList<RoleMemberBoresults = new ArrayList<RoleMemberBo>(coll.size());
        for (RoleMemberBo rm : coll) {
            if (rm.isActive(new Timestamp(System.currentTimeMillis()))) {
                results.add(rm);
            }
        }
        return results;
    }
    public List<RoleBogetRoles(Map<StringStringfieldValues) {
        Criteria criteria = new Criteria();
        Map<StringMap<StringString>> criteriaMap = setupCritMaps(fieldValues);
//      List lookupNames = boEntry.getLookupDefinition().getLookupFieldNames();
        Map<StringStringlookupNames = criteriaMap.get("lookupNames");
        for (Map.Entry<StringStringentry : lookupNames.entrySet()) {
            if (StringUtils.isNotBlank(entry.getValue())) {
                if (!entry.getKey().equals(..)) {
                    addLikeToCriteria(criteriaentry.getKey(), entry.getValue());
                } else {
                    List<StringroleIds = getRoleIdsForPrincipalName(entry.getValue());
                    if (roleIds != null && !roleIds.isEmpty()) {
                        criteria.addIn(..roleIds);
                    } else {
                        // TODO : if no role id found that means principalname not matched, need to do something to force to return empty list
                        roleIds.add("NOTFOUND");
                        criteria.addIn(..roleIds);
                    }
                }
            }
        }
        if (!criteriaMap.get("attr").isEmpty()) {
            String kimTypeId = null;
            for (Map.Entry<StringStringentry : fieldValues.entrySet()) {
                if (entry.getKey().equals("kimTypeId")) {
                    kimTypeId = entry.getValue();
                    break;
                }
            }
            setupAttrCriteria(criteriacriteriaMap.get("attr"), kimTypeId);
        }
        if (!criteriaMap.get("perm").isEmpty()) {
            criteria.addExists(setupPermCriteria(criteriaMap.get("perm")));
        }
        if (!criteriaMap.get("resp").isEmpty()) {
            criteria.addExists(setupRespCriteria(criteriaMap.get("resp")));
        }
        if (!criteriaMap.get("group").isEmpty()) {
            criteria.addExists(setupGroupCriteria(criteriaMap.get("group")));
        }
        Query q = QueryFactory.newQuery(RoleBo.classcriteria);
    }
    private List<StringgetPrincipalIdsForPrincipalName(String principalName) {
        QueryByCriteria.Builder qb = QueryByCriteria.Builder.create();
        qb.setPredicates(equal("principals.principalName"principalName));
        List<EntityDefaultentities = KimApiServiceLocator.getIdentityService().findEntityDefaults(qb.build()).getResults();
        List<StringprincipalIds = new ArrayList<String>();
        for (EntityDefault entity : entities) {
            for (Principal principal : entity.getPrincipals()) {
                principalIds.add(principal.getPrincipalId());
            }
        }
        return principalIds;
    }
    private List<StringgetRoleIdsForPrincipalName(String value) {
        String principalName = value.replace('*''%');
        List<StringroleIds = new ArrayList<String>();
        Criteria memberSubCrit = new Criteria();
        QueryByCriteria.Builder qb = QueryByCriteria.Builder.create();
        qb.setPredicates(equal("principals.principalName"principalName));
        List<EntityDefaultentities = KimApiServiceLocator.getIdentityService().findEntityDefaults(qb.build()).getResults();
        if (entities == null
                || entities.size() == 0) {
            return roleIds;
        }
        List<StringprincipalIds = new ArrayList<String>();
        for (EntityDefault entity : entities) {
            for (Principal principal : entity.getPrincipals()) {
                principalIds.add(principal.getPrincipalId());
            }
        }
        if (principalIds != null && !principalIds.isEmpty()) {
            memberSubCrit.addIn(..principalIds);
            ReportQueryByCriteria memberSubQuery = QueryFactory.newReportQuery(RoleMemberBo.classmemberSubCrit);
            for (RoleMemberBo roleMbr : (List<RoleMemberBo>) getPersistenceBrokerTemplate().getCollectionByQuery(memberSubQuery)) {
                if (roleMbr.isActive(new Timestamp(System.currentTimeMillis())) && !roleIds.contains(roleMbr.getRoleId())) {
                    roleIds.add(roleMbr.getRoleId());
                }
            }
        }
        List<StringgroupIds = new ArrayList<String>();
        for (String principalId : principalIds) {
            List<StringprincipalGroupIds = KimApiServiceLocator.getGroupService().getGroupIdsByPrincipalId(
                    principalId);
            for (String groupId : principalGroupIds) {
                if (!groupIds.contains(groupId)) {
                    groupIds.add(groupId);
                }
            }
        }
        if (groupIds != null && !groupIds.isEmpty()) {
            Criteria grpRoleCrit = new Criteria();
            grpRoleCrit.addIn(..groupIds);
            ReportQueryByCriteria memberSubQuery = QueryFactory.newReportQuery(RoleMemberBo.classgrpRoleCrit);
            for (RoleMemberBo roleMbr : (List<RoleMemberBo>) getPersistenceBrokerTemplate().getCollectionByQuery(memberSubQuery)) {
                if (roleMbr.isActive(new Timestamp(System.currentTimeMillis())) && !roleIds.contains(roleMbr.getRoleId())) {
                    roleIds.add(roleMbr.getRoleId());
                }
            }
        }
        return roleIds;
    }
    private Map<StringMap<StringString>> setupCritMaps(Map<StringStringfieldValues) {
        Map<StringMap<StringString>> critMap = new HashMap<StringMap<StringString>>();
        List<StringpermFieldName = new ArrayList<String>();
        permFieldName.add("permName");
        permFieldName.add("permNamespaceCode");
        permFieldName.add("permTmplName");
        permFieldName.add("permTmplNamespaceCode");
        List<StringrespFieldName = new ArrayList<String>();
        respFieldName.add("respName");
        respFieldName.add("respNamespaceCode");
        respFieldName.add("respTmplName");
        respFieldName.add("respTmplNamespaceCode");
        Map<StringStringpermFieldMap = new HashMap<StringString>();
        Map<StringStringrespFieldMap = new HashMap<StringString>();
        Map<StringStringattrFieldMap = new HashMap<StringString>();
        Map<StringStringgroupFieldMap = new HashMap<StringString>();
        Map<StringStringlookupNamesMap = new HashMap<StringString>();
        for (Map.Entry<StringStringentry : fieldValues.entrySet()) {
            if (StringUtils.isNotBlank(entry.getValue())) {
                String nameValue = entry.getValue().replace('*''%');
                if (permFieldName.contains(entry.getKey())) {
                    permFieldMap.put(entry.getKey(), nameValue);
                } else if (respFieldName.contains(entry.getKey())) {
                    respFieldMap.put(entry.getKey(), nameValue);
                } else if (entry.getKey().startsWith(..)) {
                    groupFieldMap.put(entry.getKey(), nameValue);
                } else if (entry.getKey().contains(".")) {
                    attrFieldMap.put(entry.getKey(), nameValue);
                } else {
                    lookupNamesMap.put(entry.getKey(), nameValue);
                }
            }
        }
        critMap.put("perm"permFieldMap);
        critMap.put("resp"respFieldMap);
        critMap.put("group"groupFieldMap);
        critMap.put("attr"attrFieldMap);
        critMap.put("lookupNames"lookupNamesMap);
        return critMap;
    }
    private void setupAttrCriteria(Criteria critMap<StringStringattrCritString kimTypeId) {
        for (Map.Entry<StringStringentry : attrCrit.entrySet()) {
            Criteria subCrit = new Criteria();
            addLikeToCriteria(subCrit"attributes.attributeValue"entry.getValue());
            addEqualToCriteria(subCrit"attributes.kimAttributeId"entry.getKey().substring(entry.getKey().indexOf(".") + 1, entry.getKey().length()));
            addEqualToCriteria(subCrit"attributes.kimTypeId"kimTypeId);
            subCrit.addEqualToField("roleId". + "roleId");
            crit.addExists(QueryFactory.newReportQuery(RoleMemberBo.classsubCrit));
        }
    }
    private ReportQueryByCriteria setupPermCriteria(Map<StringStringpermCrit) {
        List<PredicateandConds = new ArrayList<Predicate>();
        for (Map.Entry<StringStringentry : permCrit.entrySet()) {
            if (entry.getKey().equals("permTmplName") || entry.getKey().equals("permTmplNamespaceCode")) {
                if (entry.getKey().equals("permTmplName")) {
                    andConds.add(equal("template." + ..entry.getValue()));
                } else {
                     andConds.add(equal("template." + ..entry.getValue()));
                }
            }
            if (entry.getKey().equals("permName") || entry.getKey().equals("permNamespaceCode")) {
                if (entry.getKey().equals("permName")) {
                     andConds.add(equal(..entry.getValue()));
                } else {
                     andConds.add(equal(..entry.getValue()));
                }
            }
        }
        List<PermissionpermList = KimApiServiceLocator.getPermissionService().findPermissions(QueryByCriteria.Builder.fromPredicates(andConds.toArray(new Predicate[]{}))).getResults();
        List<StringroleIds = null;
        if (permList != null && !permList.isEmpty()) {
            roleIds = getRoleIdsForPermissions(permList);
        }
        if (roleIds == null || roleIds.isEmpty()) {
            roleIds = new ArrayList<String>();
            roleIds.add("-1"); // this forces a blank return.
        }
        Criteria memberSubCrit = new Criteria();
        memberSubCrit.addIn("roleId"roleIds);
        memberSubCrit.addEqualToField("roleId". + "roleId");
        return QueryFactory.newReportQuery(RoleBo.classmemberSubCrit);
    }
    private List<StringgetRoleIdsForPermissions(Collection<Permissionpermissions) {
		if ( permissions.isEmpty() ) {
			return new ArrayList<String>(0);
		}
		List<StringpermissionIds = new ArrayList<String>( permissions.size() );
		for ( Permission permission : permissions ) {
			permissionIds.addpermission.getId() );
		}
		Criteria c = new Criteria();
		c.addIn"permissionId"permissionIds );
		c.addEqualTo"active"true );
		Query query = QueryFactory.newQueryRolePermissionBo.classctrue );
		List<StringroleIds = new ArrayList<String>( coll.size() );
		for ( RolePermissionBo rp : coll ) {
			roleIds.addrp.getRoleId() );
		}
		return roleIds;
	}
    private ReportQueryByCriteria setupRespCriteria(Map<StringStringrespCrit) {
        QueryByCriteria.Builder queryByCriteriaBuilder = QueryByCriteria.Builder.create();
        List<Predicatepredicates = new ArrayList<Predicate>();
        for (Map.Entry<StringStringentry : respCrit.entrySet()) {
            if (entry.getKey().equals("respTmplName") || entry.getKey().equals("respTmplNamespaceCode")) {
                if (entry.getKey().equals("respTmplName")) {
                    predicates.add(PredicateFactory.equal("template" + ..entry.getValue()));
                } else {
                    predicates.add(PredicateFactory.equal("template." + ..entry.getValue()));
                }
            }
            if (entry.getKey().equals("respName") || entry.getKey().equals("respNamespaceCode")) {
                if (entry.getKey().equals("respName")) {
                    predicates.add(PredicateFactory.equal(..entry.getValue()));
                } else {
                    predicates.add(PredicateFactory.equal(..entry.getValue()));
                }
            }
        }
        queryByCriteriaBuilder.setPredicates(PredicateFactory.and(predicates.toArray(new Predicate[predicates.size()])));
        ResponsibilityService responsibilityService = KimApiServiceLocator.getResponsibilityService();
        ResponsibilityQueryResults results = responsibilityService.findResponsibilities(queryByCriteriaBuilder.build());
        List<Responsibilityresponsibilities = results.getResults();
        List<StringroleIds = new ArrayList<String>();
        for (Responsibility responsibility : responsibilities) {
            roleIds.addAll(responsibilityService.getRoleIdsForResponsibility(responsibility.getId()));
        }
        if (roleIds.isEmpty()) {
            roleIds.add("-1"); // this forces a blank return.
        }
        Criteria memberSubCrit = new Criteria();
        memberSubCrit.addIn("roleId"roleIds);
        memberSubCrit.addEqualToField("roleId". + "roleId");
        return QueryFactory.newReportQuery(RoleBo.classmemberSubCrit);
    }
    private ReportQueryByCriteria setupGroupCriteria(Map<String,StringgroupCrit) {
       //Map<String,String> searchCrit = new HashMap<String, String>();
       final QueryByCriteria.Builder searchCrit = QueryByCriteria.Builder.create();
       for (Entry<StringStringentry : groupCrit.entrySet()) {
                       if (entry.getKey().equals(..)) {
                               //searchCrit.put(entry.getKey(), entry.getValue());
                   searchCrit.setPredicates(equal(entry.getKey(), entry.getValue()));
                       } else { // the namespace code for the group field is named something besides the default. Set it to the default.
                               //searchCrit.put(KimApiConstants.AttributeConstants.NAMESPACE_CODE, entry.getValue());
                   searchCrit.setPredicates(equal(..entry.getValue()));
                       }
       }
       Criteria crit = new Criteria();
       List<StringgroupIds = KimApiServiceLocator.getGroupService().findGroupIds(searchCrit.build());
       if(groupIds == null || groupIds.isEmpty()){
               groupIds = new ArrayList<String>();
               groupIds.add("-1");  // this forces a blank return.
       }
       crit.addIn("memberId"groupIds);
       crit.addEqualToField("roleId". + "roleId");
                return QueryFactory.newReportQuery(RoleMemberBo.classcrit);
   }
    private void addLikeToCriteria(Criteria criteriaString propertyNameString propertyValue) {
        String[] keyValues = getCaseInsensitiveValues(propertyNamepropertyValue);
        criteria.addLike(keyValues[0], keyValues[1]);
    }
    private void addEqualToCriteria(Criteria criteriaString propertyNameString propertyValue) {
        String[] keyValues = getCaseInsensitiveValues(propertyNamepropertyValue);
        criteria.addEqualTo(keyValues[0], keyValues[1]);
    }
    private String[] getCaseInsensitiveValues(String propertyNameString propertyValue) {
        String[] keyValues = new String[2];
        keyValues[0] = propertyName == null ? "" : getDbPlatform().getUpperCaseFunction() + "(" + propertyName + ")";
        keyValues[1] = propertyValue == null ? "" : propertyValue.toUpperCase();
        return keyValues;
    }
    private boolean hasCoreRoleMemberCriteria(Map<StringStringfieldValues) {
        return StringUtils.isNotEmpty(fieldValues.get(..)) ||
                StringUtils.isNotEmpty(fieldValues.get(..)) ||
                StringUtils.isNotEmpty(fieldValues.get(..)) ||
                StringUtils.isNotEmpty(fieldValues.get(..)) ||
                StringUtils.isNotEmpty(fieldValues.get(..)) ||
                StringUtils.isNotEmpty(fieldValues.get(..));
    }
    private boolean hasExtraRoleMemberCriteria(Map<StringStringfieldValues) {
        return StringUtils.isNotEmpty(fieldValues.get(..)) ||
                StringUtils.isNotEmpty(fieldValues.get(..));
    }
    @SuppressWarnings("unchecked")
    private List<RoleBogetRoleMembersRoles(String memberNamespaceCodeString memberName) {
        Criteria queryCriteria = new Criteria();
        addEqualToCriteria(queryCriteria..memberNamespaceCode);
        addEqualToCriteria(queryCriteria..memberName);
        Query q = QueryFactory.newQuery(RoleBo.classqueryCriteria);
    }
    private List<StringgetRoleMembersGroupIds(String memberNamespaceCodeString memberName){
       QueryByCriteria.Builder builder = QueryByCriteria.Builder.create();
       builder.setPredicates(and(
                   like(..memberName),
                   like(..memberNamespaceCode)));
        return KimApiServiceLocator.getGroupService().findGroupIds(builder.build());
   }
New to GrepCode? Check out our FAQ X