@Override
    protected Set<PersonAttributes> getAttributesFromDao(final Map<String, List<Object>> seed, final boolean isFirstQuery,
                                                         final PersonAttributeDao currentlyConsidering,
                                                         final Set<PersonAttributes> resultPeople,
                                                         final PersonAttributeDaoFilter filter) {
        if (isFirstQuery || (!stopIfFirstDaoReturnsNull && (resultPeople == null || resultPeople.isEmpty()))) {
            return currentlyConsidering.getPeopleWithMultivaluedAttributes(seed, filter, resultPeople);
        }
        if (stopIfFirstDaoReturnsNull && !isFirstQuery && (resultPeople == null || resultPeople.isEmpty())) {
            return null;
        }

        Set<PersonAttributes> mergedPeopleResults = null;
        for (val person : resultPeople) {
            val queryAttributes = new LinkedHashMap<String, List<Object>>();
            val userName = person.getName();
            if (userName != null) {
                val userNameMap = this.toSeedMap(userName);
                queryAttributes.putAll(userNameMap);
            }

            val personAttributes = person.getAttributes();
            queryAttributes.putAll(personAttributes);

            if (this.addOriginalAttributesToQuery) {
                queryAttributes.putAll(seed);
            }

            val newResults = currentlyConsidering.getPeopleWithMultivaluedAttributes(queryAttributes, filter, resultPeople);
            if (newResults != null) {
                if (mergedPeopleResults == null) {
                    mergedPeopleResults = new LinkedHashSet<>(newResults);
                } else {
                    mergedPeopleResults = attributeMerger.mergeResults(mergedPeopleResults, newResults);
                }
            }
        }

        return mergedPeopleResults;
    }
If this is the first call, or there are no results in the resultPeople Set and stopIfFirstDaoReturnsNull=false,
the seed map is used. If not the attributes of the first user in the resultPeople Set are used for each child
dao.  If stopIfFirstDaoReturnsNull=true and the first query returned no results in the resultPeopleSet,
return null.
support/cas-server-support-person-directory-core/src/main/java/org/apereo/cas/persondir/CascadingPersonAttributeDao.java