Type Parameters:
T - the type of persistable entity managed by this DAO
All Known Implementing Classes:
DTODAO, GeneratedQueryDAOImpl, LLMDAOImpl, PromptDAOImpl, PromptTypeDAOImpl, SampleQueryDAOImpl

public interface DAO<T extends Persistable>
Generic Data Access Object (DAO) interface for Persistable entities.

Defines CRUD-style operations to retrieve, persist, update, and delete domain objects in the de.seggebaeing.sqlanalyzer.persistence layer.

Since:
1.0
Author:
Felix Seggebäing
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(T dto)
    Deletes the given entity from de.seggebaeing.sqlanalyzer.persistence.
    Retrieves all persisted entities of type T.
    getByID(int id)
    Retrieves a persisted entity by its identifier.
    void
    Persists a new entity or updates an existing one.
  • Method Details

    • getAll

      Set<T> getAll()
      Retrieves all persisted entities of type T.
      Returns:
      a set of all entities; may be empty if none exist
    • getByID

      T getByID(int id)
      Retrieves a persisted entity by its identifier.
      Parameters:
      id - the identifier of the entity
      Returns:
      the entity with the given id, or null if not found
    • delete

      void delete(T dto)
      Deletes the given entity from de.seggebaeing.sqlanalyzer.persistence.
      Parameters:
      dto - the entity to delete
    • saveOrUpdate

      void saveOrUpdate(T dto)
      Persists a new entity or updates an existing one.

      If the entity does not yet exist, it is created. If it already exists, its stored state is updated.

      Parameters:
      dto - the entity to save or update