Module de.seggebaeing.sqlanalyzer
Interface BusinessDomainMapper<B extends BusinessDomainObject,P extends Persistable>
- Type Parameters:
B
- business domain object typeP
- persistable DTO type
- All Known Implementing Classes:
AbstractBusinessDomainMapper
,GeneratedQueryMapper
,LLMMapper
,PromptMapper
,PromptTypeMapper
,SampleQueryMapper
public interface BusinessDomainMapper<B extends BusinessDomainObject,P extends Persistable>
Bidirectional mapper between business domain objects (BDOs) and de.seggebaeing.sqlanalyzer.persistence DTOs.
Implementations convert between BusinessDomainObject
instances and
Persistable
records and may use an injected id supplier for new objects.
-
Method Summary
Modifier and TypeMethodDescriptionMaps a business domain object to its de.seggebaeing.sqlanalyzer.persistence DTO.Maps a de.seggebaeing.sqlanalyzer.persistence DTO to its business domain counterpart.void
initialize
(Supplier<Integer> idSupplier) Injects the supplier used to allocate new identifiers when mapping objects.
-
Method Details
-
initialize
Injects the supplier used to allocate new identifiers when mapping objects.- Parameters:
idSupplier
- supplier that provides unique IDs for newly created DTOs/BDOs- Implementation Note:
- Should be called before performing mappings that require ID creation.
-
get
Maps a de.seggebaeing.sqlanalyzer.persistence DTO to its business domain counterpart.- Parameters:
dto
- the source persistable record- Returns:
- the corresponding business domain object
-
get
Maps a business domain object to its de.seggebaeing.sqlanalyzer.persistence DTO.- Parameters:
bdo
- the source business object- Returns:
- the corresponding persistable DTO
-