return new ScrollableDataSource(config.getEntityManager(), config.getDatabaseType(), query);
} else {
if (!config.isExperimentalDataSource()) {
return new ScrollableDataSource(config.getEntityManager(), config.getDatabaseType(), query);
} else {
return new ExistingPostgresDataBulkExportSource(config.getEntityManager(), query);
}
}
} else if (Task.Estimate.equals(task)) {
int limit = CallableMigrationWorker.MAX_RECORDS_TO_LOAD_FROM_SQL
* (CallableMigrationWorker.NUMBER_OF_BATCHES_FOR_ESTIMATION + 1);
if (DatabaseType.Oracle.equals(config.getDatabaseType())) {
return new ScrollableDataSource(config.getEntityManager(), config.getDatabaseType(), query, limit);
} else {
if (!config.isExperimentalDataSource()) {
return new ScrollableDataSource(config.getEntityManager(), config.getDatabaseType(), query, limit);
} else {
return new ExistingPostgresDataBulkExportSource(config.getEntityManager(), query, limit);
}
}
}
return new ScrollableDataSource(config.getEntityManager(), config.getDatabaseType(), query);