Search in sources :

Example 1 with DataExtractor

use of org.openforis.collect.relational.data.DataExtractor in project collect by openforis.

the class JooqDatabaseExporter method insertRecordData.

@Override
public void insertRecordData(CollectRecord record, ProgressListener progressListener) {
    for (DataTable table : schema.getDataTables()) {
        DataExtractor extractor = DataExtractorFactory.getRecordDataExtractor(table, record);
        batchExecutor.addInserts(extractor);
    }
}
Also used : DataTable(org.openforis.collect.relational.model.DataTable) DataExtractor(org.openforis.collect.relational.data.DataExtractor)

Example 2 with DataExtractor

use of org.openforis.collect.relational.data.DataExtractor in project collect by openforis.

the class JooqDatabaseExporter method insertReferenceData.

@Override
public void insertReferenceData(ProgressListener progressListener) {
    List<CodeTable> codeListTables = schema.getCodeListTables();
    long totalItems = codeListTables.size();
    long processedItems = 0;
    for (CodeTable codeTable : codeListTables) {
        DataExtractor extractor = DataExtractorFactory.getExtractor(codeTable);
        batchExecutor.executeInserts(extractor);
        processedItems++;
        progressListener.progressMade(new Progress(processedItems, totalItems));
    }
}
Also used : CodeTable(org.openforis.collect.relational.model.CodeTable) Progress(org.openforis.concurrency.Progress) DataExtractor(org.openforis.collect.relational.data.DataExtractor)

Aggregations

DataExtractor (org.openforis.collect.relational.data.DataExtractor)2 CodeTable (org.openforis.collect.relational.model.CodeTable)1 DataTable (org.openforis.collect.relational.model.DataTable)1 Progress (org.openforis.concurrency.Progress)1