See: Description
Interface | Description |
---|---|
DataExchangeExport | Deprecated
Since 2.3.0, replaced by
DataExchangeService . |
DataExchangeImport | Deprecated
Since 2.3.0, replaced by
DataExchangeService . |
DataExchangeTransferData | Deprecated
Since 2.3.0, replaced by
DataExchangeService . |
Class | Description |
---|---|
DataExchangeDataAccessSpec | Deprecated
Since 2.3.0, replaced by
ConfigurationSpec . |
DataExchangeExportDataAccessSpec | Deprecated
Since 2.3.0, replaced by
ExportConfigurationSpec . |
DataExchangeExportResult | Deprecated
Since 2.3.0, replaced by
DataExchangeResult . |
DataExchangeExportSpec | Deprecated
Since 2.3.0, replaced by
DataExchangeSpec . |
DataExchangeExportSQLResult | Deprecated
Since 2.3.0, replaced by
DataExchangeResult . |
DataExchangeExportSQLSpec | Deprecated
Since 2.3.0, replaced by
DataExchangeSpec . |
DataExchangeExportType | Deprecated
Since 2.3.0, replaced by
ServiceType . |
DataExchangeExportXMLSpec | Deprecated
Since 2.3.0, replaced by
DataExchangeSpec . |
DataExchangeFactory | Deprecated
Since 2.3.0, replaced by
DataExchangeServiceFactory . |
DataExchangeImportMode | Deprecated
Since 2.3.0, replaced by
ImportMode . |
DataExchangeImportResult | Deprecated
Since 2.3.0, replaced by
DataExchangeResult . |
DataExchangeImportSpec | Deprecated
Since 2.3.0, replaced by
DataExchangeSpec . |
DataExchangeImportSQLSpec | Deprecated
Since 2.3.0, replaced by
DataExchangeSpec . |
DataExchangeImportType | Deprecated
Since 2.3.0, replaced by
ServiceType . |
DataExchangeServiceType | Deprecated
Since 2.3.0, replaced by
ServiceType . |
DataExchangeSpec | Deprecated
Since 2.3.0, replaced by
DataExchangeSpec . |
DataExchangeTransferOption | Deprecated
No replacement.
|
DataExchangeTransferSpec | Deprecated
Since 2.3.0, replaced by
DataExchangeSpec . |
DataExchangeTransferType | Deprecated
Since 2.3.0, replaced by
ServiceType . |
DataResult | Deprecated
Since 2.3.0, replaced by
Result . |
TableMapping | Deprecated
Since 2.3.0, replaced by
TableMapping . |
Exception | Description |
---|---|
DataExchangeException |
This class defines a {addon.label} exception.
|
Classes and interfaces to call {addon.label} import, export and transfer data.
DataExchangeExportDataAccessSpec dataAccessSpec = new DataExchangeExportDataAccessSpec(dataset,currentTable,session); DataExchangeExportSpec exportSpec = new DataExchangeExportSpec(); exportSpec.setDataAccessSpec(dataAccessSpec); exportSpec.setTablePaths(tablePaths); exportSpec.setExportType(DataExchangeExportType.EXPORT_DEFAULT_XML); exportSpec.setTargetApplicationLogicalName(targetApplicationLogicalName); exportSpec.setTargetVersion(version); DataExchangeExportResult exportResult = DataExchangeFactory.getDataExchangeExport().execute(exportSpec);
DataExchangeDataAccessSpec dataAccessSpec = new DataExchangeDataAccessSpec(datasetOrRecord,session); File importedFile = new File(importedFilePath); DataExchangeImportSpec importSpec = new DataExchangeImportSpec(); importSpec.setDataAccessSpec(dataAccessSpec); importSpec.setTablePaths(tablePaths); importSpec.setImportedFile(importedFile); importSpec.setImportType(DataExchangeImportType.IMPORT_XML); importSpec.setImportMode(DataExchangeImportMode.UPDATE_AND_INSERT); DataExchangeImportResult importResult = DataExchangeFactory.getDataExchangeImport().execute(importSpec);
DataExchangeDataAccessSpec dataAccessSpec = new DataExchangeDataAccessSpec(dataset,currentTable,session); DataExchangeTransferSpec transferSpec = new DataExchangeTransferSpec(); transferSpec.setDataAccessSpec(dataAccessSpec); transferSpec.setTablePaths(tablePaths); transferSpec.setTransferType(DataExchangeTransferType.TRANSFER_DATA); transferSpec.setImportMode(DataExchangeImportMode.UPDATE_AND_INSERT); transferSpec.setTargetDataspace(targetDataspaceKey); transferSpec.setTargetDataset(targetDatasetName); transferSpec.setTransferOption(DataExchangeTransferOption.IN_SAME_DATA_MODEL); DataExchangeImportResult transferResult = DataExchangeFactory.getDataExchangeTransferData().execute(transferSpec);
The following example shows how to create table mappings in order to transfer data from many tables to many tables
List<TableMapping> tableMappings = new ArrayList<TableMapping>(); // case 1: Transfer data from EmployeeSourceTable table to EmployeeTargetTable table, ClassTargetTable table TableMapping firstMapping = new TableMapping(); firstMapping.setSourceTablePath(employeeSourceTablePath); firstMapping.setTargetTablePath(employeeTargetTablePath); tableMappings.add(firstMapping); TableMapping secondMapping = new TableMapping(); secondMapping.setSourceTablePath(employeeSourceTablePath); secondMapping.setTargetTablePath(classTargetTablePath); tableMappings.add(secondMapping); // case 2: Transfer data from DepartmentSourceTable table, EmployeeSourceTable table to DepartmentTargetTable table TableMapping thirdMapping = new TableMapping(); thirdMapping.setSourceTablePath(departmentSourceTablePath); thirdMapping.setTargetTablePath(departmentTargetTablePath); tableMappings.add(thirdMapping); TableMapping fourthMapping = new TableMapping(); fourthMapping.setSourceTablePath(employeeSourceTablePath); fourthMapping.setTargetTablePath(departmentTargetTablePath); tableMappings.add(fourthMapping); transferSpec.setTableMappings(tableMappings);
DataExchangeDataAccessSpec dataAccessSpec = new DataExchangeDataAccessSpec(dataset,currentTable,session); Set<SQLMappingTable> sqlMappingTables = new HashSet<SQLMappingTable>(); SQLMappingTable mappingTable = new SQLMappingTable(); mappingTable.setTablePath(tablePath); mappingTable.setSQLMappingColumnDefinition(sqlMappingColumnDefinition); SQLTableOrViewSpec sqlTableOrViewSpec = new SQLTableOrViewSpec(); sqlTableOrViewSpec.setSchemaName(schemaName); sqlTableOrViewSpec.setSQLTableOrView(sqlTableOrViewName); sqlTableOrViewSpec.setSQLPredicate(sqlPredicate); mappingTable.setSQLTableOrViewSpec(sqlTableOrViewSpec); sqlMappingTables.add(mappingTable); DataExchangeImportSQLSpec importSpec = new DataExchangeImportSQLSpec(); importSpec.setDataAccessSpec(dataAccessSpec); importSpec.setImportType(DataExchangeImportType.IMPORT_DEFAULT_SQL); importSpec.setImportMode(DataExchangeImportMode.UPDATE_AND_INSERT); importSpec.setSQLMappingTables(sqlMappingTables); DataExchangeImportResult importResult = DataExchangeFactory.getDataExchangeImport().execute(importSpec);
DataExchangeExportDataAccessSpec dataAccessSpec = new DataExchangeExportDataAccessSpec(dataset,currentTable,session); Set<SQLMappingTable> sqlMappingTables = new HashSet<SQLMappingTable>(); SQLMappingTable mappingTable = new SQLMappingTable(); mappingTable.setTablePath(tablePath); mappingTable.setSQLMappingColumnDefinition(sqlMappingColumnDefinition); SQLTableOrViewSpec sqlTableOrViewSpec = new SQLTableOrViewSpec(); sqlTableOrViewSpec.setSchemaName(schemaName); sqlTableOrViewSpec.setSQLTableOrView(sqlTableOrViewName); mappingTable.setSQLTableOrViewSpec(sqlTableOrViewSpec); sqlMappingTables.add(mappingTable); List<Path> tablePaths = new ArrayList<Path>(); tablePaths.add(tablePath); DataExchangeExportSQLSpec exportSpec = new DataExchangeExportSQLSpec(); exportSpec.setDataAccessSpec(dataAccessSpec); exportSpec.setExportType(DataExchangeExportType.EXPORT_DEFAULT_SQL); exportSpec.setSQLImportMode(DataExchangeImportMode.UPDATE_AND_INSERT); exportSpec.setSQLMappingTables(sqlMappingTables); exportSpec.setTablePaths(tablePaths); exportSpec.setPredicates(predicate); DataExchangeExportResult exportResult = DataExchangeFactory.getDataExchangeExport().execute(exportSpec);
Please refer to package com.orchestranetworks.addon.dataexchange.sql
for examples of the SQL column mapping.