Package dev.morphia.query
Interface QueryFactory
-
- All Known Implementing Classes:
AbstractQueryFactory,DefaultQueryFactory
public interface QueryFactoryA factory forQueryies.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Query<T>createQuery(Datastore datastore)Creates an unvalidatedQuerytypically for use in aggregation pipelines.<T> Query<T>createQuery(Datastore datastore, com.mongodb.DBCollection collection, java.lang.Class<T> type)Creates and returns aQueryfor the given arguments.<T> Query<T>createQuery(Datastore datastore, com.mongodb.DBCollection collection, java.lang.Class<T> type, com.mongodb.DBObject query)Creates and returns aQueryfor the given arguments.
-
-
-
Method Detail
-
createQuery
<T> Query<T> createQuery(Datastore datastore, com.mongodb.DBCollection collection, java.lang.Class<T> type)
Creates and returns aQueryfor the given arguments. Default implementations of this method will simply delegate tocreateQuery(Datastore, DBCollection, Class, DBObject)with the last argument beingnull.- Type Parameters:
T- the type of the result- Parameters:
datastore- the Datastore to usecollection- the collection to querytype- the type of the result- Returns:
- the query
- See Also:
createQuery(Datastore, DBCollection, Class, DBObject)
-
createQuery
<T> Query<T> createQuery(Datastore datastore, com.mongodb.DBCollection collection, java.lang.Class<T> type, com.mongodb.DBObject query)
Creates and returns aQueryfor the given arguments. The last argument is optional and may benull.- Type Parameters:
T- the type of the result- Parameters:
datastore- the Datastore to usecollection- the collection to querytype- the type of the resultquery- the DBObject containing the query structure- Returns:
- the query
-
-