Class YqlLimit

java.lang.Object
tech.ydb.yoj.repository.ydb.yql.YqlLimit
All Implemented Interfaces:
YqlStatementPart<YqlLimit>

public final class YqlLimit extends Object implements YqlStatementPart<YqlLimit>
Represents a LIMIT ... [OFFSET ...] clause in a YQL statement.
See Also:
  • Field Details

    • EMPTY

      public static final YqlLimit EMPTY
  • Method Details

    • range

      public static YqlLimit range(long from, long to)
      Creates a limit clause to fetch rows in the half-open range [from, to).
      Parameters:
      from - first row index, counting from 0, inclusive
      to - last row index, counting from 0, exclusive
      Returns:
      limit clause to fetch rows in range [from, to)
    • top

      public static YqlLimit top(long n)
      Creates a limit clause to fetch top n rows, as if by calling range(0, n).
      Parameters:
      n - number of rows to fetch
      Returns:
      limit clause to fetch top n rows
    • empty

      public static YqlLimit empty()
      Returns:
      limit clause that fetches no rows
      See Also:
    • size

      public long size()
    • isEmpty

      public boolean isEmpty()
    • getPriority

      public int getPriority()
      Specified by:
      getPriority in interface YqlStatementPart<YqlLimit>
    • getType

      public String getType()
      Specified by:
      getType in interface YqlStatementPart<YqlLimit>
    • getYqlPrefix

      public String getYqlPrefix()
      Specified by:
      getYqlPrefix in interface YqlStatementPart<YqlLimit>
    • toYql

      public <T extends tech.ydb.yoj.repository.db.Entity<T>> String toYql(@NonNull @NonNull tech.ydb.yoj.repository.db.EntitySchema<T> schema)
      Specified by:
      toYql in interface YqlStatementPart<YqlLimit>
    • combine

      public List<? extends YqlStatementPart<?>> combine(@NonNull @NonNull List<? extends YqlLimit> other)
      Specified by:
      combine in interface YqlStatementPart<YqlLimit>
    • toString

      public String toString()
      Overrides:
      toString in class Object