use of org.hisp.dhis.analytics.AnalyticsTableColumn in project dhis2-core by dhis2.
the class AbstractEventJdbcTableManager method createTable.
@Override
public void createTable(AnalyticsTable table) {
final String tableName = table.getTempTableName();
final String sqlDrop = "drop table " + tableName;
executeSilently(sqlDrop);
String sqlCreate = "create table " + tableName + " (";
List<AnalyticsTableColumn> columns = getDimensionColumns(table);
validateDimensionColumns(columns);
for (AnalyticsTableColumn col : columns) {
sqlCreate += col.getName() + " " + col.getDataType() + ",";
}
sqlCreate = removeLast(sqlCreate, 1) + ")";
log.info("Creating table: " + tableName + ", columns: " + columns.size());
log.debug("Create SQL: " + sqlCreate);
jdbcTemplate.execute(sqlCreate);
}
Aggregations