Package com.orchestranetworks.addon.dint.transformation.aggregate
Provides classes and interfaces for creating an aggregate transformation.
Example code for IntegerAggregate transformation:
-
Create a mapping that allows to aggregate three integer fields 'salary' and 'bonus' and 'allowance', after that map to 'total_income':
TableMapping<CSVField, EBXField> tableMapping = TableMapping.of(sourceTable, targetTable); CSVTable csvTable = sourceTable.getTable(); EBXTable ebxTable = targetTable.getTable(); tableMapping.fromSourceFieldStep(csvTable.get("salary")) .aggregate(IntegerAggregate.getInstance()) .withField(csvTable.get("bonus")) .withField(csvTable.get("allowance")) .toField(ebxTable.get(Path.parse("/total_income")));
Example code for StringConcat transformation:
-
Create a mapping that allows to concatenate two string fields 'first_name' and 'last_name', after that map to 'full_name':
TableMapping<CSVField, EBXField> tableMapping = TableMapping.of(sourceTable, targetTable); CSVTable csvTable = sourceTable.getTable(); EBXTable ebxTable = targetTable.getTable(); tableMapping.fromConstantStep("Mr/Ms.").aggregate(StringConcat.getInstance()) .withField(csvTable.get("first_name")) .withField(csvTable.get("last_name")) .param(StringConcat.SEPARATOR, " ") .toField(ebxTable.get(Path.parse("/full_name")));
-
Class Summary Class Description AggregateTransformationDefinition<I,O> Represents a transformation function ofTransformationCategory.AGGREGATE
.IntegerAggregate Represents a transformation function to aggregate integers.StringConcat Represents a transformation function to concatenate strings.