Class TableFindCursor<T,R>

java.lang.Object
com.datastax.astra.internal.command.AbstractCursor<T,R>
com.datastax.astra.client.tables.cursor.TableFindCursor<T,R>
Type Parameters:
T - working bean of parent table
R - working bean returned for the find
All Implemented Interfaces:
Cloneable, Iterable<R>

public class TableFindCursor<T,R> extends AbstractCursor<T,R>
Implementation of a cursor across the find items
  • Constructor Details

    • TableFindCursor

      public TableFindCursor(Table<T> dataSource, Filter filter, TableFindOptions options, Class<R> rowType)
      Cursor to iterate on the result of a query.
      Parameters:
      dataSource - source table
      filter - current filter
      options - options of the find operation
      rowType - row type returned with the cursor
  • Method Details

    • clone

      public TableFindCursor<T,R> clone()
      Overrides:
      clone in class Object
    • filter

      public TableFindCursor<T,R> filter(Filter newFilter)
      Immutable methods that return a new Cursor instance.
      Parameters:
      newFilter - a new filter
      Returns:
      a new cursor
    • project

      public TableFindCursor<T,R> project(Projection... newProjection)
      Creates a new TableFindCursor with an updated projection.
      Parameters:
      newProjection - the new projection to apply
      Returns:
      a new TableFindCursor instance with the specified projection
    • sort

      public TableFindCursor<T,R> sort(Sort... sort)
      Creates a new TableFindCursor with a specified sort order.
      Parameters:
      sort - the sort criteria to apply
      Returns:
      a new TableFindCursor instance with the specified sort order
    • limit

      public TableFindCursor<T,R> limit(int newLimit)
      Creates a new TableFindCursor with a specified limit on the number of results.
      Parameters:
      newLimit - the maximum number of results to retrieve
      Returns:
      a new TableFindCursor instance with the specified limit
    • skip

      public TableFindCursor<T,R> skip(int newSkip)
      Creates a new TableFindCursor that skips a specified number of results.
      Parameters:
      newSkip - the number of results to skip
      Returns:
      a new TableFindCursor instance with the specified skip value
    • includeSimilarity

      public TableFindCursor<T,R> includeSimilarity()
      Creates a new TableFindCursor that includes similarity scores in the results.
      Returns:
      a new TableFindCursor instance with similarity scores included
    • includeSortVector

      public TableFindCursor<T,R> includeSortVector()
      Creates a new TableFindCursor that includes sort vector metadata in the results.
      Returns:
      a new TableFindCursor instance with sort vector metadata included
    • fetchNextBatch

      public void fetchNextBatch()
      Fetches the next batch of documents into the buffer. This method handles paging, using the page state from the previous batch to fetch the next one.
      Specified by:
      fetchNextBatch in class AbstractCursor<T,R>
    • getKeyspace

      public String getKeyspace()
      Retrieve keyspace name.
      Returns:
      keyspace name