Interface QueryBuilder2

All Known Implementing Classes:
AbstractSqlLikeQueryBuilder2, CosmosSqlQueryBuilder2, JpaQueryBuilder2, MongoQueryBuilder2, SqlQueryBuilder2

@Internal @Introspected public interface QueryBuilder2
An interface capable of encoding a query into a string and a set of named parameters.
Since:
1.0
Author:
graemerocher, Denis Stepanov
  • Method Details

    • buildInsert

      @Nullable @Nullable QueryResult buildInsert(io.micronaut.core.annotation.AnnotationMetadata repositoryMetadata, QueryBuilder2.InsertQueryDefinition definition)
      Builds an insert statement for the given entity.
      Parameters:
      repositoryMetadata - The repository annotation metadata
      definition - The definition
      Returns:
      The insert statement or null if the implementation doesn't require insert statements
    • buildSelect

      QueryResult buildSelect(@NonNull @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, @NonNull @NonNull QueryBuilder2.SelectQueryDefinition query)
      Encode the given query for the passed annotation metadata and query.
      Parameters:
      annotationMetadata - The annotation metadata
      query - The query model
      Returns:
      The query result
    • buildUpdate

      QueryResult buildUpdate(@NonNull @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, @NonNull @NonNull QueryBuilder2.UpdateQueryDefinition definition)
      Encode the given query into the encoded query instance.
      Parameters:
      annotationMetadata - The annotation metadata
      definition - The definition
      Returns:
      The encoded query
    • buildDelete

      QueryResult buildDelete(@NonNull @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, @NonNull @NonNull QueryBuilder2.DeleteQueryDefinition definition)
      Encode the given query into the encoded query instance.
      Parameters:
      annotationMetadata - The annotation metadata
      definition - The query definition
      Returns:
      The encoded query
    • buildLimitAndOffset

      @NonNull @NonNull String buildLimitAndOffset(long limit, long offset)
      Generate the limit and offset query.
      Parameters:
      limit - The limit (-1 of not set)
      offset - The offset (0 if not set)
      Returns:
      The encoded query