Class MongoQueryBuilder
java.lang.Object
io.micronaut.data.document.model.query.builder.MongoQueryBuilder
- All Implemented Interfaces:
QueryBuilder
The Mongo query builder.
- Since:
- 3.3
- Author:
- Denis Stepanov
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected final class
The state of the query. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
An object with this property is replaced with an actual query parameter at the runtime.Fields inherited from interface io.micronaut.data.model.query.builder.QueryBuilder
VARIABLE_PATTERN
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildDelete
(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryModel query) Encode the given query into the encoded query instance.buildInsert
(io.micronaut.core.annotation.AnnotationMetadata repositoryMetadata, PersistentEntity entity) Builds an insert statement for the given entity.buildOrderBy
(PersistentEntity entity, Sort sort) Encode the given query into the encoded query instance.buildPagination
(Pageable pageable) Encode the pageable.buildQuery
(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryModel query) Encode the given query for the passed annotation metadata and query.buildUpdate
(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryModel query, List<String> propertiesToUpdate) Encode the given query into the encoded query instance.buildUpdate
(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryModel query, Map<String, Object> propertiesToUpdate) Encode the given query into the encoded query instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.data.model.query.builder.QueryBuilder
buildDelete, buildUpdate, buildUpdate, shouldAliasProjections, supportsForUpdate
-
Field Details
-
QUERY_PARAMETER_PLACEHOLDER
An object with this property is replaced with an actual query parameter at the runtime.- See Also:
-
MONGO_DATE_IDENTIFIER
- See Also:
-
MONGO_ID_FIELD
- See Also:
-
-
Constructor Details
-
MongoQueryBuilder
public MongoQueryBuilder()
-
-
Method Details
-
buildInsert
public QueryResult buildInsert(io.micronaut.core.annotation.AnnotationMetadata repositoryMetadata, PersistentEntity entity) Description copied from interface:QueryBuilder
Builds an insert statement for the given entity.- Specified by:
buildInsert
in interfaceQueryBuilder
- Parameters:
repositoryMetadata
- The repository annotation metadataentity
- The entity- Returns:
- The insert statement or null if the implementation doesn't require insert statements
-
buildQuery
public QueryResult buildQuery(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryModel query) Description copied from interface:QueryBuilder
Encode the given query for the passed annotation metadata and query.- Specified by:
buildQuery
in interfaceQueryBuilder
- Parameters:
annotationMetadata
- The annotation metadataquery
- The query model- Returns:
- The query result
-
buildUpdate
public QueryResult buildUpdate(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryModel query, List<String> propertiesToUpdate) Description copied from interface:QueryBuilder
Encode the given query into the encoded query instance.- Specified by:
buildUpdate
in interfaceQueryBuilder
- Parameters:
annotationMetadata
- The annotation metadataquery
- The querypropertiesToUpdate
- The property names to update- Returns:
- The encoded query
-
buildUpdate
public QueryResult buildUpdate(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryModel query, Map<String, Object> propertiesToUpdate) Description copied from interface:QueryBuilder
Encode the given query into the encoded query instance.- Specified by:
buildUpdate
in interfaceQueryBuilder
- Parameters:
annotationMetadata
- The annotation metadataquery
- The querypropertiesToUpdate
- The property names to update- Returns:
- The encoded query
-
buildDelete
public QueryResult buildDelete(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryModel query) Description copied from interface:QueryBuilder
Encode the given query into the encoded query instance.- Specified by:
buildDelete
in interfaceQueryBuilder
- Parameters:
annotationMetadata
- The annotation metadataquery
- The query- Returns:
- The encoded query
-
buildOrderBy
Description copied from interface:QueryBuilder
Encode the given query into the encoded query instance.- Specified by:
buildOrderBy
in interfaceQueryBuilder
- Parameters:
entity
- The root entitysort
- The sort- Returns:
- The encoded query
-
buildPagination
Description copied from interface:QueryBuilder
Encode the pageable.- Specified by:
buildPagination
in interfaceQueryBuilder
- Parameters:
pageable
- The pageable- Returns:
- The encoded query
-