this.columnNameTranslator = columnNameTranslator;
}
@Override
public Table create(JdbcIndex<?> index) {
final Table table = new Table();
onBeforeCreate(table, index);
if (table.getName() == null) {
table.setName(getIndexNameTranslator().translate(index));
}
LOG.info("Creating table {} for index {}", table.getName(), index.getName());
index.accept(new IndexFieldVisitor() {
@Override
public void visit(IndexField<?> field) {
onBeforeFieldVisit(table, field);
DataType type = getTypeMap().getType(field.getType());
if (type == null) {
onMissingTypeVisit(table, field);
return;
}
((JdbcIndexField) field).setMappedType(type);
Column column = new Column(getColumnNameTranslator().translate(field), type);
table.addElement(column);
onAfterFieldVisit(table, column, field);
}
});
onAfterCreate(table, index);