Interface GenericReadonlyRepository<T,K>


public interface GenericReadonlyRepository<T,K>
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    exists(K key)
    Determines if an entity exists for the given key.
    default Optional<T>
    find(K key)
    Finds an entity by its key.
    default List<T>
    Executes a query based on the given query specification.
  • Method Details

    • query

      default List<T> query(QuerySpecification<T> spec)
      Executes a query based on the given query specification.
      Parameters:
      spec - the query specification to execute
      Returns:
      a list of entities that match the query
    • 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
    • exists

      default boolean exists(K key)
      Determines if an entity exists for the given key.
      Parameters:
      key - the entity key