Module de.seggebaeing.sqlanalyzer
Interface DAO<T extends Persistable>
- 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 TypeMethodDescriptionvoid
Deletes the given entity from de.seggebaeing.sqlanalyzer.persistence.getAll()
Retrieves all persisted entities of typeT
.getByID
(int id) Retrieves a persisted entity by its identifier.void
saveOrUpdate
(T dto) Persists a new entity or updates an existing one.
-
Method Details
-
getAll
Retrieves all persisted entities of typeT
.- Returns:
- a set of all entities; may be empty if none exist
-
getByID
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
Deletes the given entity from de.seggebaeing.sqlanalyzer.persistence.- Parameters:
dto
- the entity to delete
-
saveOrUpdate
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
-