com.ontimize.db.sql
Class SQLPrimaryKey
java.lang.Object
com.ontimize.db.sql.SQLConstraint
com.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
|
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PRIMARY_KEY
protected static final java.lang.String PRIMARY_KEY
- See Also:
- Constant Field Values
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 constraintcolumns - 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.
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