Package dev.morphia.query
Interface QueryFactory
-
- All Known Implementing Classes:
AbstractQueryFactory
,DefaultQueryFactory
,LegacyQueryFactory
public interface QueryFactory
A factory forQuery
ies.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> Query<T>
createQuery(Datastore datastore)
Creates an unvalidatedQuery
typically for use in aggregation pipelines.<T> Query<T>
createQuery(Datastore datastore, Class<T> type)
Creates and returns aQuery
for the given arguments.<T> Query<T>
createQuery(Datastore datastore, Class<T> type, org.bson.Document query)
Creates and returns aQuery
for the given arguments.<T> Query<T>
createQuery(Datastore datastore, String collection, Class<T> type)
Creates and returns aQuery
for the given arguments.
-
-
-
Method Detail
-
createQuery
<T> Query<T> createQuery(Datastore datastore, Class<T> type)
Creates and returns aQuery
for the given arguments. Default implementations of this method will simply delegate tocreateQuery(Datastore, Class)
with the last argument beingnull
.- Type Parameters:
T
- the type of the result- Parameters:
datastore
- the Datastore to usetype
- the type of the result- Returns:
- the query
-
createQuery
<T> Query<T> createQuery(Datastore datastore, String collection, Class<T> type)
Creates and returns aQuery
for the given arguments. Default implementations of this method will simply delegate tocreateQuery(Datastore, Class)
with the last argument beingnull
.- 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
-
createQuery
<T> Query<T> createQuery(Datastore datastore, Class<T> type, org.bson.Document query)
Creates and returns aQuery
for the given arguments. The last argument is optional and may benull
.- 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
-
-