Interface CursorPagedRepository<T,K,C>

Type Parameters:
T - the type of entity
K - the type of key
C - the type of the cursor

public interface CursorPagedRepository<T,K,C>
Represents a repository that allows cursor-based pagination for querying and manipulating entities.
  • Method Details

    • query

      Executes a query based on the given query specification.
      Parameters:
      spec - the query specification to execute
      Returns:
      a result containing the entities that match the query and cursor pagination information
    • query

      Executes a query based on the given query specification.
      Parameters:
      spec - the query specification to execute
      Returns:
      a result containing the entities that match the query and cursor pagination information
    • find

      default Optional<T> find(K key)
      Finds an entity by its key.
      Parameters:
      key - the key of the entity
      Returns:
      an Optional containing the entity if found, or an empty Optional if not found
    • update

      default T update(T entity)
      Updates an entity in the repository.
      Parameters:
      entity - the entity to be updated
      Returns:
      the updated entity
    • update

      default int update(UpdateSpecification spec)
      Updates entities in the repository based on the provided update specification.
      Parameters:
      spec - the update specification defining the update criteria and data
      Returns:
      the number of rows affected by the update operation
    • remove

      default void remove(T entity)
      Removes an entity from the repository.
      Parameters:
      entity - the entity to be removes
    • remove

      default int remove(UpdateSpecification spec)
      Removes entities from the repository according to the specifications provided.
      Parameters:
      spec - the update specification defining the criteria for entity removal
      Returns:
      the number of rows affected by the remove operation
    • clear

      default void clear()
      Deletes all entities from the repository.