java.lang.Object
de.seggebaeing.sqlanalyzer.logic.service.LLMService
- All Implemented Interfaces:
BDOService<LLM>
Service layer for managing
LLM
business objects.
Provides CRUD-style operations by mapping between LLM
and LLMDTO
via LLMMapper
and persisting through LLMDAOImpl
.
Initializes the mapper with an id supplier from the DAO. Implements a singleton pattern
(use getInstance()
) and synchronizes public mutating/access methods for basic thread safety.
Also exposes direct dependants lookup (e.g., GeneratedQuery
that reference an LLM).
- Since:
- 1.0
- Author:
- Felix Seggebäing
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes the given LLM by mapping it to its DTO and delegating to the DAO.getAll()
Retrieves all persisted LLMs and maps them to business objects.getDependants
(LLM object) Returns business objects that directly reference the given LLM.static LLMService
void
saveOrUpdate
(LLM bdo) Saves a new LLM or updates an existing one by mapping it to its DTO and delegating to the DAO.
-
Method Details
-
getInstance
-
getAll
Retrieves all persisted LLMs and maps them to business objects.Thread-safe: synchronized to guard access to the underlying DAO and mapper.
- Specified by:
getAll
in interfaceBDOService<LLM>
- Returns:
- a set of
LLM
; may be empty
-
delete
Deletes the given LLM by mapping it to its DTO and delegating to the DAO.Thread-safe: synchronized to guard DAO/mapper access.
- Specified by:
delete
in interfaceBDOService<LLM>
- Parameters:
bdo
- the LLM to delete
-
saveOrUpdate
Saves a new LLM or updates an existing one by mapping it to its DTO and delegating to the DAO.Thread-safe: synchronized to guard DAO/mapper access.
- Specified by:
saveOrUpdate
in interfaceBDOService<LLM>
- Parameters:
bdo
- the LLM to save or update
-
getDependants
Returns business objects that directly reference the given LLM.Scans all
GeneratedQuery
instances and collects those whose generator is the providedobject
.- Specified by:
getDependants
in interfaceBDOService<LLM>
- Parameters:
object
- the LLM whose dependants to collect- Returns:
- list of dependants; empty if none
- Implementation Note:
- Uses reference equality on
gq.getGenerator()
.
-