Package org.dizitart.no2.repository
Interface Cursor<T>
-
- All Superinterfaces:
Iterable<T>
,RecordStream<T>
public interface Cursor<T> extends RecordStream<T>
An interface to iterate overObjectRepository.find()
results.- Since:
- 1.0
- Author:
- Anindya Chatterjee
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FindPlan
getFindPlan()
Gets a filter plan for the query.<Foreign,Joined>
RecordStream<Joined>join(Cursor<Foreign> foreignCursor, Lookup lookup, Class<Joined> type)
Performs a left outer join with a foreign cursor with the specified lookup parameters.<P> RecordStream<P>
project(Class<P> projectionType)
Projects the result of one type into anIterable
of another type.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.dizitart.no2.common.RecordStream
firstOrNull, isEmpty, size, toList, toSet
-
-
-
-
Method Detail
-
getFindPlan
FindPlan getFindPlan()
Gets a filter plan for the query.- Returns:
- the filter plan
-
project
<P> RecordStream<P> project(Class<P> projectionType)
Projects the result of one type into anIterable
of another type.- Type Parameters:
P
- the type of the target objects.- Parameters:
projectionType
- the projection type.- Returns:
- java.lang.Iterable of projected objects.
-
join
<Foreign,Joined> RecordStream<Joined> join(Cursor<Foreign> foreignCursor, Lookup lookup, Class<Joined> type)
Performs a left outer join with a foreign cursor with the specified lookup parameters.It performs an equality match on the localField to the foreignField from the objects of the foreign cursor. If an input object does not contain the localField, the join treats the field as having a value of
null
for matching purposes.- Type Parameters:
Foreign
- the type of the foreign object.Joined
- the type of the joined object.- Parameters:
foreignCursor
- the foreign cursor for the join.lookup
- the lookup parameter for the join operation.type
- the type of the joined record.- Returns:
- a lazy iterable of joined objects.
- Since:
- 2.1.0
-
-