public class PrimaryKey extends java.lang.Object implements Constraint
COMMA, CONSTRAINT, FOREIGNKEY, FOREIGNKEYSTRING, JOINCONDITIONCONSTRAINT, LEFTPARENTH, NOTNULLCONSTRAINT, NOTNULLSTRING, PRIMARYKEY, PRIMARYKEYSTRING, REFERENCESTRING, RIGHTPARENTH, SPACESTRING, UNIQUEKEY, UNIQUEKEYSTRING
Constructor and Description |
---|
PrimaryKey() |
Modifier and Type | Method and Description |
---|---|
java.lang.String[] |
getKeys()
Method to get keys
|
java.lang.String |
getName()
Method to get constrain name
|
int |
getType()
Method to get constrain type
|
java.lang.String |
printString()
Method to transfer a primary key into sql command (table constraint) The
string will look like: CONSTRAINT constrain_name Primary Key ( col1,
col2, ...)
|
void |
setKeys(java.lang.String[] keyList)
Method to set keys in constraint
|
void |
setName(java.lang.String constraintName)
Method to set constraint name
|
public PrimaryKey()
public int getType()
getType
in interface Constraint
public java.lang.String getName()
public java.lang.String[] getKeys()
public void setName(java.lang.String constraintName)
constraintName
- Stringpublic void setKeys(java.lang.String[] keyList)
keyList
- String[]public java.lang.String printString() throws UnWellFormedConstraintException
printString
in interface Constraint
UnWellFormedConstraintException