protected <T extends Any<?>> List<T> buildResult(final List<Object> raw, final AnyTypeKind kind) { List<T> result = new ArrayList<>(); raw.stream().map(anyKey -> anyKey instanceof Object[] ? (String) ((Object[]) anyKey)[0] : ((String) anyKey)). forEachOrdered(actualKey -> { @SuppressWarnings("unchecked") T any = kind == AnyTypeKind.USER ? (T) userDAO.find(actualKey) : kind == AnyTypeKind.GROUP ? (T) groupDAO.find(actualKey) : (T) anyObjectDAO.find(actualKey); if (any == null) { LOG.error("Could not find {} with id {}, even if returned by native query", kind, actualKey); } else if (!result.contains(any)) { result.add(any); } }); return result; }
scce.addException(invalidAnyType); } else { AnyObject otherEnd = anyObjectDAO.find(patch.getRelationshipTO().getOtherEndKey()); if (otherEnd == null) { LOG.debug("Ignoring invalid any object {}", patch.getRelationshipTO().getOtherEndKey());
any = anyObjectDAO.find(((AnyObjectTO) before).getKey()); } else if (output instanceof AnyObjectTO) { any = anyObjectDAO.find(((AnyObjectTO) output).getKey()); } else if (output instanceof ProvisioningResult && ((ProvisioningResult) output).getEntity() instanceof AnyObjectTO) { any = anyObjectDAO.find(((ProvisioningResult) output).getEntity().getKey()); } else if (before instanceof GroupTO) { any = groupDAO.find(((GroupTO) before).getKey());
AnyObject otherEnd = anyObjectDAO.find(patch.getRelationshipTO().getOtherEndKey()); if (otherEnd == null) { LOG.debug("Ignoring invalid any object {}", patch.getRelationshipTO().getOtherEndKey());
? userDAO.find(anyKey) : init.getMiddle().getKind() == AnyTypeKind.ANY_OBJECT ? anyObjectDAO.find(anyKey) : groupDAO.find(anyKey); if (any == null) {
scce.addException(invalidAnyType); } else { AnyObject otherEnd = anyObjectDAO.find(relationshipTO.getOtherEndKey()); if (otherEnd == null) { LOG.debug("Ignoring invalid anyObject " + relationshipTO.getOtherEndKey());
AnyObject otherEnd = anyObjectDAO.find(relationshipTO.getOtherEndKey()); if (otherEnd == null) { LOG.debug("Ignoring invalid anyObject " + relationshipTO.getOtherEndKey());