Interface BaseRepository<T,I>

Type Parameters:
T - The entity type this repository manages
I - The type of the entity's identifier
All Known Implementing Classes:
AbstractRepository, ConfigValueRepository, MemberRepository, PointsRepository, TaskAssignmentRepository, TaskRepository

public interface BaseRepository<T,I>
Defines core data access operations for entity persistence. Provides standard CRUD methods that all repositories must implement.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes an entity from the database.
    Retrieves all entities of the managed type.
    findById(I id)
    Finds an entity by its identifier.
    save(T entity)
    Persists an entity to the database.
  • Method Details

    • findById

      Optional<T> findById(I id)
      Finds an entity by its identifier.
      Parameters:
      id - The entity identifier
      Returns:
      An Optional containing the found entity or empty if not found
    • findAll

      List<T> findAll()
      Retrieves all entities of the managed type.
      Returns:
      A list of all entities
    • save

      T save(T entity)
      Persists an entity to the database. Creates a new record if the entity has no ID, otherwise updates the existing record.
      Parameters:
      entity - The entity to save
      Returns:
      The saved entity with any database-generated values (like ID) populated
    • deleteById

      void deleteById(I id)
      Removes an entity from the database.
      Parameters:
      id - The identifier of the entity to delete