Module de.seggebaeing.sqlanalyzer
Class GeneratedQueryMapper
java.lang.Object
de.seggebaeing.sqlanalyzer.logic.domainmapper.AbstractBusinessDomainMapper<GeneratedQuery,GeneratedQueryDTO>
de.seggebaeing.sqlanalyzer.logic.domainmapper.GeneratedQueryMapper
- All Implemented Interfaces:
BusinessDomainMapper<GeneratedQuery,
GeneratedQueryDTO>
public class GeneratedQueryMapper
extends AbstractBusinessDomainMapper<GeneratedQuery,GeneratedQueryDTO>
Bidirectional mapper between
GeneratedQuery
and
GeneratedQueryDTO
.
Maintains caches in both directions and refreshes entries when the source
side has a newer version
. Resolves associated objects via
LLMMapper
/ PromptMapper
and their DAOs to map generator
and prompt references. Singleton — access via getInstance()
.
- Since:
- 1.0
- Author:
- Felix Seggebäing
-
Field Summary
Fields inherited from class de.seggebaeing.sqlanalyzer.logic.domainmapper.AbstractBusinessDomainMapper
cacheMapBDOtoDTO, cacheMapDTOtoBDO, idSupplier
-
Method Summary
Modifier and TypeMethodDescriptionget
(GeneratedQuery bdo) Maps aGeneratedQuery
to itsGeneratedQueryDTO
with caching.get
(GeneratedQueryDTO dto) Maps aGeneratedQueryDTO
to aGeneratedQuery
with caching.static GeneratedQueryMapper
Methods inherited from class de.seggebaeing.sqlanalyzer.logic.domainmapper.AbstractBusinessDomainMapper
initialize, putIntoMaps, putIntoMaps
-
Method Details
-
getInstance
-
get
Maps aGeneratedQueryDTO
to aGeneratedQuery
with caching.Resolves
generatorId
andpromptId
via DAOs and maps them usingLLMMapper
andPromptMapper
. Refreshes the cache entry when the DTO'sversion
is newer than the cached BDO.- Parameters:
dto
- the source DTO; may benull
- Returns:
- the mapped
GeneratedQuery
, ornull
ifdto
isnull
-
get
Maps aGeneratedQuery
to itsGeneratedQueryDTO
with caching.Reuses the cached DTO if up to date; otherwise creates a new DTO, reusing the cached ID or allocating one via
idSupplier
. Generator and prompt references are mapped viaLLMMapper
andPromptMapper
;-1
is stored if a reference isnull
or cannot be mapped. The cache is refreshed when the BDO'sversion
is newer.- Parameters:
bdo
- the source business object; may benull
- Returns:
- the mapped DTO, or
null
ifbdo
isnull
-