final List<ISqlJetColumnConstraint> constraints = column.getConstraints();
if (null == constraints)
continue;
for (final ISqlJetColumnConstraint constraint : constraints) {
if (constraint instanceof ISqlJetColumnPrimaryKey) {
final ISqlJetColumnPrimaryKey pk = (ISqlJetColumnPrimaryKey) constraint;
if (!column.hasExactlyIntegerType()) {
if (pk.isAutoincremented()) {
throw new SqlJetException(SqlJetErrorCode.ERROR,
"AUTOINCREMENT is allowed only for INTEGER PRIMARY KEY fields");
}
createAutoIndex(schemaTable, tableName, generateAutoIndexName(tableName, ++i));
} else if (pk.isAutoincremented()) {
checkSequenceTable();
}
} else if (constraint instanceof ISqlJetColumnUnique) {
createAutoIndex(schemaTable, tableName, generateAutoIndexName(tableName, ++i));
}
}
}
final List<ISqlJetTableConstraint> constraints = tableDef.getConstraints();
if (null != constraints) {
for (final ISqlJetTableConstraint constraint : constraints) {
if (constraint instanceof ISqlJetTablePrimaryKey) {
boolean b = false;
final ISqlJetTablePrimaryKey pk = (ISqlJetTablePrimaryKey) constraint;
if (pk.getColumns().size() == 1) {
final String n = pk.getColumns().get(0);
final ISqlJetColumnDef c = tableDef.getColumn(n);
b = c != null && c.hasExactlyIntegerType();
}
if (!b) {
createAutoIndex(schemaTable, tableName, generateAutoIndexName(tableName, ++i));