Module de.seggebaeing.sqlanalyzer
Class SampleQueryMapper
java.lang.Object
de.seggebaeing.sqlanalyzer.logic.domainmapper.AbstractBusinessDomainMapper<SampleQuery,SampleQueryDTO>
de.seggebaeing.sqlanalyzer.logic.domainmapper.SampleQueryMapper
- All Implemented Interfaces:
BusinessDomainMapper<SampleQuery,
SampleQueryDTO>
Bidirectional mapper between
SampleQuery
and SampleQueryDTO
.
Maintains caches in both directions and refreshes entries when the source side has a newer version
.
Allocates IDs via an injected supplier for new DTOs.
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
(SampleQuery bdo) Maps aSampleQuery
business object to itsSampleQueryDTO
with caching.get
(SampleQueryDTO dto) Maps aSampleQueryDTO
to itsSampleQuery
counterpart with caching.static SampleQueryMapper
Methods inherited from class de.seggebaeing.sqlanalyzer.logic.domainmapper.AbstractBusinessDomainMapper
initialize, putIntoMaps, putIntoMaps
-
Method Details
-
getInstance
-
get
Maps aSampleQueryDTO
to itsSampleQuery
counterpart with caching.Returns the cached BDO if present and up to date; otherwise creates a new
SampleQuery
from the DTO fields (convertingcomplexity
string toSampleQuery.Complexity
when non-null), updates the bidirectional cache, and returns it.- Parameters:
dto
- the source DTO; may benull
- Returns:
- the mapped
SampleQuery
, ornull
ifdto
isnull
- Implementation Note:
- The cache is refreshed when the DTO's
version
is newer than the cached BDO'sversion
.
-
get
Maps aSampleQuery
business object to itsSampleQueryDTO
with caching.Returns the cached DTO if present and up to date; otherwise creates a new DTO, reusing the existing ID if cached or allocating one via
idSupplier
if not. The cache is refreshed when the BDO'sversion
is newer than the cached DTO's.- Parameters:
bdo
- the source business object; may benull
- Returns:
- the mapped
SampleQueryDTO
, ornull
ifbdo
isnull
-