Module de.seggebaeing.sqlanalyzer
Class PromptMapper
java.lang.Object
de.seggebaeing.sqlanalyzer.logic.domainmapper.AbstractBusinessDomainMapper<Prompt,PromptDTO>
de.seggebaeing.sqlanalyzer.logic.domainmapper.PromptMapper
- All Implemented Interfaces:
BusinessDomainMapper<Prompt,
PromptDTO>
Bidirectional mapper between
Prompt
and PromptDTO
.
Maintains BDO↔DTO caches and refreshes entries when the source side has a newer version
.
Resolves referenced objects via SampleQueryMapper
/PromptTypeMapper
and their DAOs.
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
Methods inherited from class de.seggebaeing.sqlanalyzer.logic.domainmapper.AbstractBusinessDomainMapper
initialize, putIntoMaps, putIntoMaps
-
Method Details
-
getInstance
-
get
Maps aPromptDTO
to aPrompt
with caching.Resolves referenced entities (sample query, prompt type) via their DAOs and mappers. Refreshes the cached mapping if the DTO has a newer
version
.- Parameters:
dto
- the source DTO; may benull
- Returns:
- the mapped
Prompt
, ornull
ifdto
isnull
-
get
Maps aPrompt
to itsPromptDTO
with caching.Reuses the cached DTO if up to date; otherwise creates a new DTO, reusing the cached ID or allocating one via
idSupplier
. Maps referenced sample query and prompt type; stores-1
if a reference isnull
or cannot be mapped.- Parameters:
bdo
- the source business object; may benull
- Returns:
- the mapped DTO, or
null
ifbdo
isnull
-