Interface BusinessDomainMapper<B extends BusinessDomainObject,P extends Persistable>

Type Parameters:
B - business domain object type
P - 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 Type
    Method
    Description
    get(B bdo)
    Maps a business domain object to its de.seggebaeing.sqlanalyzer.persistence DTO.
    get(P dto)
    Maps a de.seggebaeing.sqlanalyzer.persistence DTO to its business domain counterpart.
    void
    Injects the supplier used to allocate new identifiers when mapping objects.
  • Method Details

    • initialize

      void initialize(Supplier<Integer> idSupplier)
      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

      B get(P dto)
      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

      P get(B bdo)
      Maps a business domain object to its de.seggebaeing.sqlanalyzer.persistence DTO.
      Parameters:
      bdo - the source business object
      Returns:
      the corresponding persistable DTO