Class MongoQueryBuilder2

java.lang.Object
io.micronaut.data.document.model.query.builder.MongoQueryBuilder2
All Implemented Interfaces:
QueryBuilder2

@Internal public final class MongoQueryBuilder2 extends Object implements QueryBuilder2
The Mongo query builder.
Since:
3.3
Author:
Denis Stepanov
  • Field Details

  • 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 interface QueryBuilder2
      Parameters:
      repositoryMetadata - The repository annotation metadata
      insertQueryDefinition - 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 interface QueryBuilder2
      Parameters:
      annotationMetadata - The annotation metadata
      selectQueryDefinition - 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 interface QueryBuilder2
      Parameters:
      annotationMetadata - The annotation metadata
      updateQueryDefinition - 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 interface QueryBuilder2
      Parameters:
      annotationMetadata - The annotation metadata
      queryDefinition - The query definition
      Returns:
      The encoded query
    • buildLimitAndOffset

      public String buildLimitAndOffset(long limit, long offset)
      Description copied from interface: QueryBuilder2
      Generate the limit and offset query.
      Specified by:
      buildLimitAndOffset in interface QueryBuilder2
      Parameters:
      limit - The limit (-1 of not set)
      offset - The offset (0 if not set)
      Returns:
      The encoded query