Interface DataTableConfig

All Superinterfaces:
de.calamanari.adl.cnv.tps.ArgMetaInfoLookup, Serializable
All Known Implementing Classes:
DummyDataTableConfig, MultiTableConfig, SingleTableConfig

public interface DataTableConfig extends de.calamanari.adl.cnv.tps.ArgMetaInfoLookup
A concrete DataTableConfig maps columns to argNames.

Notes:

  • The same attribute (argName) cannot be mapped to multiple columns.
  • It is possible to map multiple attributes to the same column.
Author:
Karl Eilebrecht
  • Method Details

    • lookupAssignment

      ArgColumnAssignment lookupAssignment(String argName, de.calamanari.adl.ProcessContext ctx)
      Determines the column assignment for the given argName.
      Parameters:
      argName -
      ctx -
      Returns:
      the configured ArgColumnAssignment if ArgMetaInfoLookup.contains(String)=true, otherwise throws exception
      Throws:
      de.calamanari.adl.cnv.tps.LookupException - if there is no assignment for the given argName
      IllegalArgumentException - if argName was null
    • numberOfTables

      int numberOfTables()
      Returns the total number of tables in this configuration
      Returns:
      number of tables this config is based on, >=1
    • numberOfTablesInvolved

      default int numberOfTablesInvolved(List<String> argNames, de.calamanari.adl.ProcessContext ctx)
      Performs a lookup for each of the given argNames and counts the related tables (distinct count).
      Parameters:
      argNames -
      ctx -
      Returns:
      the number of tables mapped to the given list of attributes
      Throws:
      de.calamanari.adl.cnv.tps.LookupException - if there is no assignment for any given argName
      IllegalArgumentException - if any given argName was null
    • tablesInvolved

      default List<String> tablesInvolved(List<String> argNames, de.calamanari.adl.ProcessContext ctx)
      Returns a list of the names of all table any of the given argNames is mapped to.

      The result order depends on the order of the provided argNames.

      Parameters:
      argNames -
      ctx -
      Returns:
      the names of the tables mapped to the given list of attributes, free of duplicates, sorted
      Throws:
      de.calamanari.adl.cnv.tps.LookupException - if there is no assignment for any given argName
      IllegalArgumentException - if any given argName was null
    • lookup

      default de.calamanari.adl.cnv.tps.ArgMetaInfo lookup(String argName)
      Specified by:
      lookup in interface de.calamanari.adl.cnv.tps.ArgMetaInfoLookup
    • lookupColumn

      default DataColumn lookupColumn(String argName, de.calamanari.adl.ProcessContext ctx)
      Returns the data column mapped to the given argName.
      Parameters:
      argName -
      ctx -
      Returns:
      the configured DataColumn if ArgMetaInfoLookup.contains(String)=true, otherwise throws exception
      Throws:
      de.calamanari.adl.cnv.tps.LookupException - if there is no assignment for the given argName
      IllegalArgumentException - if argName was null
    • lookupTableMetaInfo

      TableMetaInfo lookupTableMetaInfo(String argName, de.calamanari.adl.ProcessContext ctx)
      Returns the table meta infos for the column that is mapped to the given argName
      Parameters:
      argName -
      ctx -
      Returns:
      meta data
      Throws:
      de.calamanari.adl.cnv.tps.LookupException - if there is no TableMetaInfo for the given argName
      IllegalArgumentException - if argName was null
    • allTableMetaInfos

      List<TableMetaInfo> allTableMetaInfos()
      Returns the meta information for all the tables in this configuration.

      Important: Although the order is not defined, best case the order in the list reflects the order of configuration.
      In any case it must be stable and it should be deterministic because this is the order the default implementations of several other methods relies on. If the result is composed from an underlying set, then the list should be sorted before returning to avoid indeterministic behavior like flaky tests or unexplainable variations when generating queries.

      Returns:
      all configured tables
    • tableMetaInfosInvolved

      default List<TableMetaInfo> tableMetaInfosInvolved(List<String> argNames, de.calamanari.adl.ProcessContext ctx)
      Returns a list of the meta infos of all table any of the given argNames is mapped to.

      The order result order depends on the order of the provided argNames.

      Parameters:
      argNames -
      ctx -
      Returns:
      the names of the tables mapped to the given list of attributes, free of duplicates
      Throws:
      de.calamanari.adl.cnv.tps.LookupException - if there is no assignment for any given argName
      IllegalArgumentException - if any given argName was null
    • tablesThatContainAllIds

      default List<String> tablesThatContainAllIds()
      Returns all tables from the config that contain all IDs.
      Returns:
      list of the names of all configured tables that are marked TableNature.containsAllIds() or "the only table at all"
      See Also:
    • primaryTable

      default String primaryTable()
      Returns the primary table of this configuration.
      Returns:
      name of the table that is marked as primary table or null if no table is marked as primary table
      See Also:
    • lookupTableMetaInfoByTableName

      default TableMetaInfo lookupTableMetaInfoByTableName(String tableName)
      Shorthand for finding the meta info in allTableMetaInfos() by table name
      Parameters:
      tableName -
      Returns:
      table meta info
      Throws:
      de.calamanari.adl.cnv.tps.LookupException - if there is no info about the given table name
      IllegalArgumentException - if any given tableName was null