private Iterator<Authorizable> findAuthorizables(@Nonnull String statement,
long limit,
long offset,
@Nullable AuthorizableType type) throws RepositoryException {
try {
QueryEngine queryEngine = root.getQueryEngine();
Iterable<? extends ResultRow> resultRows = queryEngine.executeQuery(statement, javax.jcr.query.Query.XPATH, limit, offset, null, namePathMapper).getRows();
Iterator<Authorizable> authorizables = Iterators.transform(resultRows.iterator(), new ResultRowToAuthorizable(userManager, root, type));
return Iterators.filter(authorizables, new UniqueResultPredicate());
} catch (ParseException e) {
log.warn("Invalid user query: " + statement, e);
throw new RepositoryException(e);