Class MongoQueryBuilder2
java.lang.Object
io.micronaut.data.document.model.query.builder.MongoQueryBuilder2
- All Implemented Interfaces:
QueryBuilder2
The Mongo query builder.
- Since:
- 3.3
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.data.model.query.builder.QueryBuilder2
QueryBuilder2.BaseQueryDefinition, QueryBuilder2.DeleteQueryDefinition, QueryBuilder2.InsertQueryDefinition, QueryBuilder2.SelectQueryDefinition, QueryBuilder2.UpdateQueryDefinition
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuildDelete
(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryBuilder2.DeleteQueryDefinition queryDefinition) Encode the given query into the encoded query instance.buildInsert
(io.micronaut.core.annotation.AnnotationMetadata repositoryMetadata, QueryBuilder2.InsertQueryDefinition insertQueryDefinition) Builds an insert statement for the given entity.buildLimitAndOffset
(long limit, long offset) Generate the limit and offset query.buildSelect
(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryBuilder2.SelectQueryDefinition selectQueryDefinition) Encode the given query for the passed annotation metadata and query.buildUpdate
(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryBuilder2.UpdateQueryDefinition updateQueryDefinition) Encode the given query into the encoded query instance.
-
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
-
MongoQueryBuilder2
public MongoQueryBuilder2()
-
-
Method Details
-
buildInsert
public QueryResult buildInsert(io.micronaut.core.annotation.AnnotationMetadata repositoryMetadata, QueryBuilder2.InsertQueryDefinition insertQueryDefinition) Description copied from interface:QueryBuilder2
Builds an insert statement for the given entity.- Specified by:
buildInsert
in interfaceQueryBuilder2
- Parameters:
repositoryMetadata
- The repository annotation metadatainsertQueryDefinition
- The definition- Returns:
- The insert statement or null if the implementation doesn't require insert statements
-
buildSelect
public QueryResult buildSelect(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryBuilder2.SelectQueryDefinition selectQueryDefinition) Description copied from interface:QueryBuilder2
Encode the given query for the passed annotation metadata and query.- Specified by:
buildSelect
in interfaceQueryBuilder2
- Parameters:
annotationMetadata
- The annotation metadataselectQueryDefinition
- The query model- Returns:
- The query result
-
buildUpdate
public QueryResult buildUpdate(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryBuilder2.UpdateQueryDefinition updateQueryDefinition) Description copied from interface:QueryBuilder2
Encode the given query into the encoded query instance.- Specified by:
buildUpdate
in interfaceQueryBuilder2
- Parameters:
annotationMetadata
- The annotation metadataupdateQueryDefinition
- The definition- Returns:
- The encoded query
-
buildDelete
public QueryResult buildDelete(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, QueryBuilder2.DeleteQueryDefinition queryDefinition) Description copied from interface:QueryBuilder2
Encode the given query into the encoded query instance.- Specified by:
buildDelete
in interfaceQueryBuilder2
- Parameters:
annotationMetadata
- The annotation metadataqueryDefinition
- The query definition- Returns:
- The encoded query
-
buildLimitAndOffset
Description copied from interface:QueryBuilder2
Generate the limit and offset query.- Specified by:
buildLimitAndOffset
in interfaceQueryBuilder2
- Parameters:
limit
- The limit (-1 of not set)offset
- The offset (0 if not set)- Returns:
- The encoded query
-