The parameter containermust be an object of the class class that implements the interface Iterablefor the type R. For instance:
neo4jtemplate.findAll(Line.class).as(MyClassThatIteratesOverTypeR.class);
If the type is Iterable Point, it is possible:
class PointIterator implements Iterable<Point> {
}
:
class PointIterator extends ArrayList<Point> { }
neo4jtemplate.findAll(Line.class).as(PointIterator.class);
, :
neo4jtemplate.findAll(Line.class).as(ArrayList<R>.class); // can't do this