use of org.openforis.collect.relational.jooq.JooqRelationalSchemaCreator in project collect by openforis.
the class RDBReportingRepositories method createRepository.
@Override
public void createRepository(final String surveyName, final RecordStep recordStep, final String preferredLanguage, final ProgressListener progressListener) {
localRDBStorageManager.deleteRDBFile(surveyName, recordStep);
updateMondrianSchemaFile(surveyName, preferredLanguage);
if (saikuDatasourceStorageManager.isSaikuAvailable()) {
writeSaikuDatasource(surveyName, recordStep);
}
final RelationalSchema relationalSchema = getOrInitializeRelationalSchemaDefinition(surveyName);
withConnection(surveyName, recordStep, new Callback() {
public void execute(Connection connection) {
RelationalSchemaCreator relationalSchemaCreator = new JooqRelationalSchemaCreator();
relationalSchemaCreator.createRelationalSchema(relationalSchema, connection);
insertRecords(surveyName, recordStep, relationalSchema, connection, progressListener);
relationalSchemaCreator.addConstraints(relationalSchema, connection);
relationalSchemaCreator.addIndexes(relationalSchema, connection);
}
});
}
Aggregations