Module de.seggebaeing.sqlanalyzer
Class PromptTypeService
java.lang.Object
de.seggebaeing.sqlanalyzer.logic.service.PromptTypeService
- All Implemented Interfaces:
BDOService<PromptType>
Service layer for managing
PromptType
business objects.
Maps between PromptType
and PromptTypeDTO
via PromptTypeMapper
and persists through
PromptTypeDAOImpl
. Implements a singleton
(use getInstance()
) and synchronizes public operations for basic
thread safety. Provides dependant lookup (e.g., Prompt
referencing a given prompt type).
- Since:
- 1.0
- Author:
- Felix Seggebäing
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(PromptType bdo) Deletes the given prompt type by mapping it to its DTO and delegating to the DAO.getAll()
Retrieves all persisted prompt types and maps them to business objects.getDependants
(PromptType object) Returns business objects that directly reference the given prompt type.static PromptTypeService
void
saveOrUpdate
(PromptType bdo) Saves a new prompt type or updates an existing one by mapping it to its DTO and delegating to the DAO.
-
Method Details
-
getInstance
-
getAll
Retrieves all persisted prompt types and maps them to business objects.Thread-safe: synchronized to guard DAO/mapper access.
- Specified by:
getAll
in interfaceBDOService<PromptType>
- Returns:
- a set of
PromptType
; may be empty
-
delete
Deletes the given prompt type by mapping it to its DTO and delegating to the DAO.Thread-safe: synchronized to guard DAO/mapper access.
- Specified by:
delete
in interfaceBDOService<PromptType>
- Parameters:
bdo
- the prompt type to delete
-
saveOrUpdate
Saves a new prompt type 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<PromptType>
- Parameters:
bdo
- the prompt type to save or update
-
getDependants
Returns business objects that directly reference the given prompt type.Scans all
Prompt
instances and collects those whosegetType()
is the same instance asobject
(reference equality).- Specified by:
getDependants
in interfaceBDOService<PromptType>
- Parameters:
object
- the prompt type whose dependants to collect- Returns:
- list of dependants; empty if none
-