Package dev.morphia.query
Interface QueryFactory
- All Known Implementing Classes:
DefaultQueryFactory
@MorphiaInternal
public interface QueryFactory
A factory for queries.
- See Also:
Developer note.
This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> Query<T>createQuery(Datastore datastore, Class<T> type, FindOptions options) Creates a new query for the given type.<T> Query<T>createQuery(Datastore datastore, Class<T> type, FindOptions options, Document query) Creates and returns aQueryfor the given arguments.default <T> Query<T>createQuery(Datastore datastore, String collection, Class<T> type) Deprecated.
-
Method Details
-
createQuery
Creates a new query for the given type.- Type Parameters:
T- the query type- Parameters:
datastore- the datastoretype- the query typeoptions- the find options- Returns:
- the new query
-
createQuery
<T> Query<T> createQuery(Datastore datastore, Class<T> type, FindOptions options, @Nullable Document 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 usetype- the type of the resultoptions- the find optionsquery- the Document containing the query structure- Returns:
- the query
-
createQuery
Deprecated.Creates and returns aQueryfor the given arguments. Default implementations of this method will simply delegate tocreateQuery(Datastore, Class, FindOptions)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, FindOptions, Document)