Package dev.morphia.query
Interface QueryFactory
-
- All Known Implementing Classes:
AbstractQueryFactory
,DefaultQueryFactory
,LegacyQueryFactory
public interface QueryFactory
A factory for queries.- See Also:
Query
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default <T> Query<T>
createQuery(Datastore datastore)
Deprecated, for removal: This API element is subject to removal in a future version.this method is no longer useddefault <T> Query<T>
createQuery(Datastore datastore, Class<T> type)
Creates a new query for the given type.<T> Query<T>
createQuery(Datastore datastore, Class<T> type, 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
default <T> Query<T> createQuery(Datastore datastore, Class<T> type)
Creates a new query for the given type.- Type Parameters:
T
- the query type- Parameters:
datastore
- the datastoretype
- the query type- Returns:
- the new query
-
createQuery
<T> Query<T> createQuery(Datastore datastore, Class<T> type, @Nullable 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
-
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
- See Also:
createQuery(Datastore, Class)
-
createQuery
@Deprecated(forRemoval=true) default <T> Query<T> createQuery(Datastore datastore)
Deprecated, for removal: This API element is subject to removal in a future version.this method is no longer usedCreates an unvalidatedQuery
typically for use in aggregation pipelines.- Type Parameters:
T
- the type of the result- Parameters:
datastore
- the Datastore to use- Returns:
- the query
-
-