/** * Add a constraint statement to this statement. The primary key definition is * one possible constraint statement. * * @param command * the statement to add */ public void addConstraintCommand(DefineCommand command) { if (command instanceof CreateIndex) { getConstraintCommands().add(command); } else { AlterTableAddConstraint con = (AlterTableAddConstraint) command; boolean alreadySet; if (con.getType() == CommandInterface.ALTER_TABLE_ADD_CONSTRAINT_PRIMARY_KEY) { alreadySet = setPrimaryKeyColumns(con.getIndexColumns()); } else { alreadySet = false; } if (!alreadySet) { getConstraintCommands().add(command); } } }