Record Class MultiTableConfig
- Record Components:
tableConfigs- overlap-free single-table configurations NOT NULL, not empty
- All Implemented Interfaces:
de.calamanari.adl.cnv.tps.ArgMetaInfoLookup, DataTableConfig, Serializable
MultiTableConfig is composed of SingleTableConfigs to map argNames uniquely to columns of multiple tables.- Author:
- Karl Eilebrecht
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMultiTableConfig(List<SingleTableConfig> tableConfigs) Creates an instance of aMultiTableConfigrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the meta information for all the tables in this configuration.booleanfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.lookupAssignment(String argName, de.calamanari.adl.ProcessContext ctx) Determines the column assignment for the given argName.lookupTableMetaInfo(String argName, de.calamanari.adl.ProcessContext ctx) Returns the table meta infos for the column that is mapped to the given argNameintReturns the total number of tables in this configurationReturns the value of thetableConfigsrecord component.final StringtoString()Returns a string representation of this record class.withTable(SingleTableConfig table) Entry point to start with the given table and fluently set up tables in the the physical data model and along with it the logical data model (mapped argNames)withTable(SingleTableConfig table, de.calamanari.adl.cnv.tps.ArgMetaInfoLookup argMetaInfoLookup) Entry point to start with the given table and fluently set up tables mapped to existing argNamesEntry point for fluently setting up a table in the the physical data model and along with it the logical data model (mapped argNames)Entry point for setting up a table and for mapping it to existing argNamesMethods inherited from interface de.calamanari.adl.cnv.tps.ArgMetaInfoLookup
isAlwaysKnown, isCollection, lookup, typeOfMethods inherited from interface DataTableConfig
lookup, lookupColumn, lookupTableMetaInfoByTableName, numberOfTablesInvolved, primaryTable, tableMetaInfosInvolved, tablesInvolved, tablesThatContainAllIds
-
Constructor Details
-
MultiTableConfig
Creates an instance of aMultiTableConfigrecord class.- Parameters:
tableConfigs- the value for thetableConfigsrecord component
-
-
Method Details
-
withTable
Entry point for fluently setting up a table in the the physical data model and along with it the logical data model (mapped argNames)This is more for testing convenience. The recommended way is first creating a logical data model with all the argNames and then calling
withTable(String, ArgMetaInfoLookup)to setup the table(s) and create a mapping.- Parameters:
tableName- physical table name- Returns:
- builder
-
withTable
Entry point to start with the given table and fluently set up tables in the the physical data model and along with it the logical data model (mapped argNames)This is more for testing convenience. The recommended way is first creating a logical data model with all the argNames and then calling
withTable(String, ArgMetaInfoLookup)to setup the table(s) and create a mapping.- Parameters:
table- already configured table- Returns:
- builder
-
withTable
public static ConfigBuilderInterfaces.MultiTableStep1 withTable(String tableName, de.calamanari.adl.cnv.tps.ArgMetaInfoLookup argMetaInfoLookup) Entry point for setting up a table and for mapping it to existing argNames- Parameters:
tableName-argMetaInfoLookup- (logical data model with all the argNames)- Returns:
- builder
-
withTable
public static ConfigBuilderInterfaces.MultiTableAddTableOrExit withTable(SingleTableConfig table, de.calamanari.adl.cnv.tps.ArgMetaInfoLookup argMetaInfoLookup) Entry point to start with the given table and fluently set up tables mapped to existing argNames- Parameters:
table- first table to addargMetaInfoLookup- (logical data model with all the argNames)- Returns:
- builder
-
contains
- Specified by:
containsin interfacede.calamanari.adl.cnv.tps.ArgMetaInfoLookup
-
lookupAssignment
Description copied from interface:DataTableConfigDetermines the column assignment for the given argName.- Specified by:
lookupAssignmentin interfaceDataTableConfig- Parameters:
argName-ctx-- Returns:
- the configured
ArgColumnAssignmentifArgMetaInfoLookup.contains(String)=true, otherwise throws exception
-
numberOfTables
public int numberOfTables()Description copied from interface:DataTableConfigReturns the total number of tables in this configuration- Specified by:
numberOfTablesin interfaceDataTableConfig- Returns:
- number of tables this config is based on, >=1
-
lookupTableMetaInfo
Description copied from interface:DataTableConfigReturns the table meta infos for the column that is mapped to the given argName- Specified by:
lookupTableMetaInfoin interfaceDataTableConfig- Parameters:
argName-ctx-- Returns:
- meta data
-
allTableMetaInfos
Description copied from interface:DataTableConfigReturns 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.- Specified by:
allTableMetaInfosin interfaceDataTableConfig- Returns:
- all configured tables
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
tableConfigs
Returns the value of thetableConfigsrecord component.- Returns:
- the value of the
tableConfigsrecord component
-