com.atlassian.confluence.upgrade.ddl
Class AddUniqueConstraintCommand

java.lang.Object
  extended by com.atlassian.confluence.upgrade.ddl.AddUniqueConstraintCommand
All Implemented Interfaces:
AlterTableCommand

public class AddUniqueConstraintCommand
extends Object
implements AlterTableCommand

Represents a unique constraint on a set of columns. Beware columns that allow null values! On SQL Server and Oracle, nulls are distinct values (and so constraints over them will prevent two rows containing nulls in those columns). On MySQL nulls will cause the constraint to be ignored, no matter the values in any other constrained columns. On DB2, nullable columns cannot have unique constraints at all.


Constructor Summary
AddUniqueConstraintCommand(String constraintName, Collection<String> columns)
           
 
Method Summary
 String getCommandName()
           
 String getCommandParameters()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddUniqueConstraintCommand

public AddUniqueConstraintCommand(String constraintName,
                                  Collection<String> columns)
Method Detail

getCommandName

public String getCommandName()
Specified by:
getCommandName in interface AlterTableCommand
Returns:
The keyword/name of the current command for the current database (e.g. altering a column is "alter column" on PostgreSQL and "modify" on MySQL.

getCommandParameters

public String getCommandParameters()
Specified by:
getCommandParameters in interface AlterTableCommand
Returns:
The part that comes after the command name. E.g. "colname set not null" which would be after "alter column colname set not null"


Copyright © 2003–2015 Atlassian. All rights reserved.