Ontimize 5.2072EN

com.ontimize.db.sql
Class SQLPrimaryKey

java.lang.Object
  extended bycom.ontimize.db.sql.SQLConstraint
      extended bycom.ontimize.db.sql.SQLPrimaryKey
All Implemented Interfaces:
java.io.Serializable

public class SQLPrimaryKey
extends SQLConstraint

See Also:
Serialized Form

Field Summary
protected static java.lang.String PRIMARY_KEY
           
 
Fields inherited from class com.ontimize.db.sql.SQLConstraint
columns, CONSTRAINT, constraintName
 
Constructor Summary
SQLPrimaryKey(java.util.List columns)
          Creates a new SQLPrimaryKey just indicating the column/s in where the constraint is applied.
SQLPrimaryKey(java.lang.String constraintName)
          Creates a new SQLPrimaryKey indicating the name of the constraint.Only use to drop constraints.
SQLPrimaryKey(java.lang.String constraintName, java.util.List columns)
          Creates a new SQLPrimaryKey indicating the name of the constraint and the columns in where the constraint is applied.
 
Method Summary
 java.lang.String toString()
          This method returns the SQL Statement to add a Primary Key constraint to a database table.
 
Methods inherited from class com.ontimize.db.sql.SQLConstraint
getColumnList, getColumns, getConstraintName, setConstraintName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PRIMARY_KEY

protected static final java.lang.String PRIMARY_KEY
See Also:
Constant Field Values
Constructor Detail

SQLPrimaryKey

public SQLPrimaryKey(java.lang.String constraintName,
                     java.util.List columns)
Creates a new SQLPrimaryKey indicating the name of the constraint and the columns in where the constraint is applied.

Parameters:
constraintName - Name of the constraint
columns - The list of columns in where the constraint is applied.

SQLPrimaryKey

public SQLPrimaryKey(java.lang.String constraintName)
Creates a new SQLPrimaryKey indicating the name of the constraint.Only use to drop constraints.

Parameters:
constraintName - Name of the constraint

SQLPrimaryKey

public SQLPrimaryKey(java.util.List columns)
Creates a new SQLPrimaryKey just indicating the column/s in where the constraint is applied. The name of the constraint is generated by default.

Parameters:
columns - The list of columns in where the constraint is applied.
Method Detail

toString

public java.lang.String toString()
This method returns the SQL Statement to add a Primary Key constraint to a database table. Returns a String with the SQL Statement


Ontimize