Package dev.morphia.query
Class DefaultQueryFactory
- java.lang.Object
-
- dev.morphia.query.DefaultQueryFactory
-
- All Implemented Interfaces:
QueryFactory
public class DefaultQueryFactory extends Object implements QueryFactory
A default implementation ofQueryFactory.
-
-
Constructor Summary
Constructors Constructor Description DefaultQueryFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Query<T>createQuery(Datastore datastore, Class<T> type, Document query)Creates and returns aQueryfor the given arguments.<T> Query<T>createQuery(Datastore datastore, String collection, Class<T> type)Creates and returns aQueryfor the given arguments.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface dev.morphia.query.QueryFactory
createQuery, createQuery
-
-
-
-
Method Detail
-
createQuery
public <T> Query<T> createQuery(Datastore datastore, String collection, Class<T> type)
Description copied from interface:QueryFactoryCreates and returns aQueryfor the given arguments. Default implementations of this method will simply delegate toQueryFactory.createQuery(Datastore, Class)with the last argument beingnull.- Specified by:
createQueryin interfaceQueryFactory- Type Parameters:
T- the type of the result- Parameters:
datastore- the Datastore to usecollection- the actual collection to query. This overrides any mapped on collection on type.type- the type of the result- Returns:
- the query
- See Also:
QueryFactory.createQuery(Datastore, Class)
-
createQuery
public <T> Query<T> createQuery(Datastore datastore, Class<T> type, @Nullable Document query)
Description copied from interface:QueryFactoryCreates and returns aQueryfor the given arguments. The last argument is optional and may benull.- Specified by:
createQueryin interfaceQueryFactory- Type Parameters:
T- the type of the result- Parameters:
datastore- the Datastore to usetype- the type of the resultquery- the Document containing the query structure- Returns:
- the query
-
-