Skip Headers

# Building the Query

Previous

Next

You can configure any finder that returns a `java.util.Collection` to use a cursor. When you create the query for the finder, add the `useCursoredStream` option to enable cursoring.

Cursored Stream in a Finder

    ReadAllQuery raq = new ReadAllQuery(ProjectBean.class);
    ExpressionBuilder bldr = raq.getExpressionBuilder();
    raq.useCursoredStream();
    raq.addArgument("projectName");
    raq.setSelectionCriteria(bldr.get("name").
    like(bldr.getParameter("projectName")));
    descriptor.getQueryManager().addQuery ("findByNameCursored", query);