Interface EdmxFlavourMapper

All Known Implementing Classes:
NoopEdmxFlavourMapper, V4EdmxFlavourMapper

public interface EdmxFlavourMapper
Maps data which is in an EDMX-defined structure to CSN-defined structure and vice versa.
  • Method Details

    • create

      static EdmxFlavourMapper create(EdmxFlavourMapper.EdmxFlavour flavour, boolean toCsn)
    • remap

      String remap(String element, com.sap.cds.reflect.CdsStructuredType type)
      Remaps a simple element name of a given structured type
      Parameters:
      element - the element name
      type - the structured type
      Returns:
      the mapped element name
    • remap

      default <T extends Map<String, Object>> T remap(T entry, com.sap.cds.reflect.CdsStructuredType entryType)
      Remaps a data map of a given structured type
      Type Parameters:
      T - the map type
      Parameters:
      entry - the data map
      entryType - the structured type of the entry
      Returns:
      the mapped data map
    • remap

      default <T extends Iterable<? extends Map<String, Object>>> T remap(T entries, com.sap.cds.reflect.CdsStructuredType entryType)
      Remaps an Iterable of data maps of a given structured type
      Type Parameters:
      T - the Iterable type
      Parameters:
      entries - an Iterable of data maps
      entryType - the structured type of the entries
      Returns:
      the mapped Iterable of data maps
    • remap

      <T extends Iterable<? extends Map<String, Object>>> T remap(T entries, com.sap.cds.reflect.CdsStructuredType entryType, Function<String,Boolean> isExpanded)
      Remaps an Iterable of data maps of a given structured type
      Type Parameters:
      T - the Iterable type
      Parameters:
      entries - an Iterable of data maps
      entryType - the structured type of the entries
      isExpanded - a function to determine if the given path is expanded
      Returns:
      the mapped Iterable of data maps
    • createMappings

      Stream<? extends EdmxFlavourMapper.Mapping> createMappings(com.sap.cds.reflect.CdsStructuredType type)
      A stream of EdmxFlavourMapper.Mapping instances for each element of a CdsStructuredType.
      Parameters:
      type - the CdsStructuredType
      Returns:
      the stream of all EdmxFlavourMapper.Mapping instances