/** * 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); } } }
if (alterTbl.getType() != Command.ALTER_TABLE_ADD_CONSTRAINT_PRIMARY_KEY) throw new IgniteSQLException("Unsupported type of constraint for CREATE TABLE - only PRIMARY KEY " + "is supported", IgniteQueryErrorCode.UNSUPPORTED_OPERATION);
/** * 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) { constraintCommands.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) { constraintCommands.add(command); } } }
/** * 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) { constraintCommands.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) { constraintCommands.add(command); } } }
/** * 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(Prepared command) throws SQLException { if (command instanceof CreateIndex) { constraintCommands.add(command); } else { AlterTableAddConstraint con = (AlterTableAddConstraint) command; boolean alreadySet; if (con.getType() == AlterTableAddConstraint.PRIMARY_KEY) { alreadySet = setPrimaryKeyColumns(con.getIndexColumns()); } else { alreadySet = false; } if (!alreadySet) { constraintCommands.add(command); } } }
if (alterTbl.getType() != Command.ALTER_TABLE_ADD_CONSTRAINT_PRIMARY_KEY) throw new IgniteSQLException("Unsupported type of constraint for CREATE TABLE - only PRIMARY KEY " + "is supported", IgniteQueryErrorCode.UNSUPPORTED_OPERATION);