public Node getManagerByUuid(final String managerUuid, ServiceFactory sf) { Parameters p = new Parameters(); p.addString("uuid", managerUuid).setFilter( new Filter().page(0, 1)); return (Node) sf.getQueryService().findByQuery( "select n from Node n where uuid = :uuid", p); };
private static Filter filter(RoiOptions opts) { Filter f = new Filter(); if (opts != null) { if (opts.userId != null) { f.owner(opts.userId.getValue()); } if (opts.groupId != null) { f.group(opts.groupId.getValue()); } Integer offset = null; Integer limit = null; if (opts.offset != null) { offset = opts.offset.getValue(); } if (opts.limit != null) { limit = opts.limit.getValue(); } if (offset != null || limit != null) { f.page(offset, limit); } } return f; }