Class RecordIdRange

java.lang.Object
com.surrealdb.RecordIdRange

public final class RecordIdRange extends Object
Represents a range of record IDs on a table for range queries (e.g. select/update/delete/upsert over IDs between a start and an end bound, either of which may be unbounded).

Use Id.from(long), Id.from(String), or Id.from(java.util.UUID) for bounds. Pass null for start or end to make that bound unbounded.

RecordIdRange(String, Id, Id) includes both bounds (table:start..=end). Use RecordIdRange(String, Id, boolean, Id, boolean) to exclude either bound, for example new RecordIdRange("t", a, true, b, false) is SurrealQL's t:a..b.

  • Constructor Details

    • RecordIdRange

      public RecordIdRange(String table, Id start, Id end)
      Creates a range over the given table with optional start and end bounds, both inclusive.
      Parameters:
      table - table name
      start - lower bound (inclusive), or null for unbounded
      end - upper bound (inclusive), or null for unbounded
    • RecordIdRange

      public RecordIdRange(String table, Id start, boolean startInclusive, Id end, boolean endInclusive)
      Creates a range over the given table, choosing whether each bound is inclusive or exclusive.
      Parameters:
      table - table name
      start - lower bound, or null for unbounded
      startInclusive - whether records whose ID equals start are included
      end - upper bound, or null for unbounded
      endInclusive - whether records whose ID equals end are included
  • Method Details

    • getTable

      public String getTable()
    • getStart

      public Id getStart()
      Lower bound, or null if unbounded.
    • isStartInclusive

      public boolean isStartInclusive()
      Whether the lower bound is inclusive. Meaningless when the range has no lower bound.
    • getEnd

      public Id getEnd()
      Upper bound, or null if unbounded.
    • isEndInclusive

      public boolean isEndInclusive()
      Whether the upper bound is inclusive. Meaningless when the range has no upper bound.