Class MongoQueryBuilder

java.lang.Object
io.micronaut.data.document.model.query.builder.MongoQueryBuilder
All Implemented Interfaces:
QueryBuilder

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

  • 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 interface QueryBuilder
      Parameters:
      repositoryMetadata - The repository annotation metadata
      entity - 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 interface QueryBuilder
      Parameters:
      annotationMetadata - The annotation metadata
      query - 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 interface QueryBuilder
      Parameters:
      annotationMetadata - The annotation metadata
      query - The query
      propertiesToUpdate - 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 interface QueryBuilder
      Parameters:
      annotationMetadata - The annotation metadata
      query - The query
      propertiesToUpdate - 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 interface QueryBuilder
      Parameters:
      annotationMetadata - The annotation metadata
      query - The query
      Returns:
      The encoded query
    • buildOrderBy

      public QueryResult buildOrderBy(PersistentEntity entity, Sort sort)
      Description copied from interface: QueryBuilder
      Encode the given query into the encoded query instance.
      Specified by:
      buildOrderBy in interface QueryBuilder
      Parameters:
      entity - The root entity
      sort - The sort
      Returns:
      The encoded query
    • buildPagination

      public QueryResult buildPagination(Pageable pageable)
      Description copied from interface: QueryBuilder
      Encode the pageable.
      Specified by:
      buildPagination in interface QueryBuilder
      Parameters:
      pageable - The pageable
      Returns:
      The encoded query