Interface OffsetPagedRepository<T,K>

Type Parameters:
T - the type of entity stored in the repository
K - the type of the entity's key

public interface OffsetPagedRepository<T,K>
Represents a repository with offset-based pagination functionality.
  • Method Details

    • query

      default OffsetPagedResult<T> query(QuerySpecification<T> spec)
      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 offset 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 offset 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 according to the specifications provided.
      Parameters:
      spec - the update specification that defines the conditions and parameters for the update
      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 deleted
    • 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.