See: Description
Interface | Description |
---|---|
DataIntegrationExecutionResults |
Contains all results of a data integration execution.
|
TableMappingResult |
Result for a
TableMapping after performing a data integration execution. |
Class | Description |
---|---|
DataFormatOptions |
Global options for formatting and parsing various data types.
|
DataIntegrationExecutor |
Executes a data integration task.
|
DataIntegrationSpec |
Global specification for a data integration task.
|
Exception | Description |
---|---|
DataIntegrationException |
Represents an error with user-friendly message happened during a data integration task.
|
Provides classes and interfaces to execute a data integration task.
The main class of this package isDataIntegrationExecutor
, which performs a data integration task between a SourceTable
and a TargetTable
. Use a TableMapping
to map source and target fields. In case the fields of source and target table are the same structure or label, you can use the provided FieldMatcher
.
To determine which field in the source table will match with which field in the target table, you have to define in TableMapping
. In case you want to transform data, you can add transformations to field mappings. For more information, refer to the packages related to transformation functions. Get integration results using DataIntegrationExecutionResults
.
Get an instance of EBXSourceTable
:
EBXSourceTableSpec ebxSourceTableSpec = EBXSourceTableSpec .newBuilder(adaptationTable, session) .setIncludeComputedValuesOption(false) .build(); EBXSourceTable ebxSourceTable = EBXSourceTable.newInstance(ebxSourceTableSpec);
Get an instance of CSVTargetTable
:
CSVTargetTableSpec csvTargetTableSpec = CSVTargetTableSpec.newBuilder(outputFile) .setFirstRowHeader(true) .setFieldLabels(ebxSourceTable.getLabels()) .build(); CSVTargetTable csvTargetTable = CSVTargetTable.newInstance(csvTargetTableSpec);
Get an instance of TableMapping
with FieldMatcher
:
TableMappingtableMapping = TableMapping.of(ebxSourceTable, csvTargetTable); List ebxFields = ebxSourceTable.getTable().getFields(); List csvFields = csvTargetTable.getTable().getFields(); tableMapping.mapFieldsWithMatcher(ebxFields, csvFields, FieldMatcher.getMatcherByLabelIgnoreCase());
Get an instance of DataIntegrationSpec
:
MappingSpec mappingSpec = MappingSpec.of(tableMapping); DataIntegrationSpec dataIntegrationSpec = new DataIntegrationSpec(session, mappingSpec);
Execute a DataIntegrationSpec
and get result:
DataIntegrationExecutionResults exportResults = DataIntegrationExecutor.getInstance().execute(dataIntegrationSpec);
Get an instance of ExcelSourceTable
:
ExcelSourceTableSpec excelSourceTableSpec = ExcelSourceTableSpec .newBuilder(fileToImport) .setFirstRowHeader(true) .setSheetName("Employee") .build(); ExcelSourceTable excelSourceTable = ExcelSourceTable.newInstance(excelSourceTableSpec);
Get an instance of EBXTargetTable
:
EBXTargetTableSpec targetTableSpec = EBXTargetTableSpec .newBuilder(adaptationTable, session) .setWriteMode(EBXWriteMode.UPDATE_OR_INSERT) .setNullOrEmptyPrimaryKeyAllowed(false) .build(); EBXTargetTable ebxTargetTable = EBXTargetTable.newInstance(targetTableSpec);
Get an instance of TableMapping
with mapping manually :
TableMappingtableMapping = TableMapping.of(excelSourceTable, ebxTargetTable); List csvFields = excelSourceTable.getTable().getFields(); List ebxFields = ebxTargetTable.getTable().getFields(); for (int i = 0; i < ebxFields.size(); i++) { tableMapping.mapFields(csvFields.get(i), ebxFields.get(i)); }
Get an instance of DataIntegrationSpec
:
MappingSpec mappingSpec = MappingSpec.of(tableMapping); DataIntegrationSpec dataIntegrationSpec = new DataIntegrationSpec(session, mappingSpec);
Execute a DataIntegrationSpec
and get result:
DataIntegrationExecutionResults exportResults = DataIntegrationExecutor.getInstance().execute(dataIntegrationSpec);
Get an instance of EBXSourceTable
:
EBXSourceTableSpec ebxSourceTableSpec = EBXSourceTableSpec .newBuilder(adaptationTable, session) .setForeignKeyHierarchyIncluded(false) // when both sides are EBX, foreign keys should be configured as normal fields, not a hierarchies .build(); EBXSourceTable ebxSourceTable = EBXSourceTable.newInstance(ebxSourceTableSpec);
Get an instance of EBXTargetTable
:
EBXTargetTableSpec targetTableSpec = EBXTargetTableSpec .newBuilder(adaptationTable, session) .setWriteMode(EBXWriteMode.UPDATE_OR_INSERT) .setNullOrEmptyPrimaryKeyAllowed(false) .setForeignKeyHierarchyIncluded(false) // when both sides are EBX, foreign keys should be configured as normal fields, not a hierarchies .build(); EBXTargetTable ebxTargetTable = EBXTargetTable.newInstance(targetTableSpec);
Get an instance of TableMapping
with FieldMatcher
:
TableMappingtableMapping = TableMapping.of(excelSourceTable, ebxTargetTable); List sourceFields = ebxSourceTable.getTable().getFields(); List targetFields = ebxTargetTable.getTable().getFields(); tableMapping.mapFieldsWithMatcher(sourceFields, targetFields, FieldMatcher.getMatcherByLabelIgnoreCase());
Get an instance of DataIntegrationSpec
:
MappingSpec mappingSpec = MappingSpec.of(tableMapping); DataIntegrationSpec dataIntegrationSpec = new DataIntegrationSpec(session, mappingSpec);
Execute a DataIntegrationSpec
and get result:
DataIntegrationExecutionResults exportResults = DataIntegrationExecutor.getInstance().execute(dataIntegrationSpec);
Get an instance of CSVExportTemplateSpec
:
CSVExportTemplateSpec templateSpec = new CSVExportTemplateSpec( "7c67ed6a-3106-47b0-9bf8-0440e6238657", //this's template uuid, you can get from admin page. outputFile, session);
Execute a DataIntegrationSpec
and get result:
DataIntegrationExecutionResults exportResults = DataIntegrationExecutor.getInstance().execute(templateSpec);