public class ForeignKey extends java.lang.Object implements Constraint
COMMA, CONSTRAINT, FOREIGNKEY, FOREIGNKEYSTRING, JOINCONDITIONCONSTRAINT, LEFTPARENTH, NOTNULLCONSTRAINT, NOTNULLSTRING, PRIMARYKEY, PRIMARYKEYSTRING, REFERENCESTRING, RIGHTPARENTH, SPACESTRING, UNIQUEKEY, UNIQUEKEYSTRING
Constructor and Description |
---|
ForeignKey()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getEntityReference()
Method to get referenced entity
|
java.lang.String[] |
getKeys()
Method to get keys
|
java.lang.String |
getName()
Method to get constraint name
|
int |
getType()
Method to get type
|
java.lang.String |
printString()
Method to print out a part sql command about foreign key In foreign key,
you don't need to specify the referenced entity's column name, the
primary key column(s) of the referenced table is used as the referenced
column(s)
|
void |
setEntityReference(java.lang.String referencedEntity)
Method to set referenced entity name
|
void |
setKeys(java.lang.String[] constraintKeys)
Method to set keys
|
void |
setName(java.lang.String constraintName)
Method to set constraint name
|
public ForeignKey()
public int getType()
getType
in interface Constraint
public java.lang.String getName()
public java.lang.String[] getKeys()
public java.lang.String getEntityReference()
public void setName(java.lang.String constraintName)
constraintName
- Stringpublic void setKeys(java.lang.String[] constraintKeys)
constraintKeys
- String[]public void setEntityReference(java.lang.String referencedEntity)
referencedEntity
- Stringpublic java.lang.String printString() throws UnWellFormedConstraintException
printString
in interface Constraint
UnWellFormedConstraintException