Interface AOMapper<T extends Entity,U>

All Known Subinterfaces:
RelatedAOMapper<P,T,U>
All Known Implementing Classes:
AbstractAOMapper, AuditEntryAOMapper, BalancerEntryAOMapper, BoardAdminAOMapper, CardColorAOMapper, CardLayoutFieldAOMapper, ColumnAOMapper, DetailViewFieldAOMapper, EstimateStatisticAOMapper, NonWorkingDayAOMapper, QuickFilterAOMapper, SprintAOMapper, SubqueryAOMapper, SwimlaneAOMapper, TrackingStatisticAOMapper, VersionMetaDataAOMapper, WorkingDaysAOMapper

public interface AOMapper<T extends Entity,U>
Common interface for mapping between AO records of type AOMapper to domain objects of type AOMapper.
Since:
v5.9.5
  • Method Summary

    Modifier and Type
    Method
    Description
    toAO(U model)
    Return a mapping of AO column names to values which will represent the domain object.
    toModel(T record)
    Constructs a (usually immutable) domain object from the AO record.
    void
    update(U source, T target)
    Copies fields from a domain object to the AO record representation.
  • Method Details

    • toAO

      @Nonnull Map<String,Object> toAO(U model)
      Return a mapping of AO column names to values which will represent the domain object.

      The keys of the map must be the exact names of the columns as they will appear in AO. E.g. for a column fieldId the column name would be FIELD_ID.

      Note: the ID (primary key) column does not need to be included. This is only used when persisting new domain objects to AO.

      Parameters:
      model - the new domain object
      Returns:
      a map containing the columns and values
    • toModel

      @Nonnull U toModel(T record)
      Constructs a (usually immutable) domain object from the AO record.
      Parameters:
      record - the record to use
      Returns:
      the domain object
    • update

      void update(U source, T target)
      Copies fields from a domain object to the AO record representation. Note that the save() method must not be called.
      Parameters:
      source - the domain object
      target - the corresponding AO record