|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.castor.ddlgen.schemaobject.AbstractSchemaObject
org.castor.ddlgen.schemaobject.ForeignKey
public abstract class ForeignKey
Abstract base class for all foreign keys.
Field Summary | |
---|---|
static int |
MANY_MANY
Relation type: many-many. |
static int |
ONE_MANY
Relation type: one-many. |
static int |
ONE_ONE
Relation type: one-one. |
Fields inherited from class org.castor.ddlgen.schemaobject.AbstractSchemaObject |
---|
HASHFACTOR |
Constructor Summary | |
---|---|
ForeignKey()
|
Method Summary | |
---|---|
void |
addField(Field field)
Add given field to list of foreign key fields. |
void |
addReferenceField(Field field)
Add given field to list of fields referenced by the foreign key. |
boolean |
equals(java.lang.Object other)
|
protected void |
fieldNames(DDLWriter writer)
Concatenate all field names delimited by field delimiter and whitespace. |
Field |
getField(int index)
Get foreign key field at given index. |
int |
getFieldCount()
Get number of foreign key fields. |
Field |
getReferenceField(int index)
Get field referenced by the foreign key at given index. |
int |
getReferenceFieldCount()
Get number of fields referenced by the foreign key. |
Table |
getReferenceTable()
Get table referenced by the foreign key. |
int |
getRelationType()
Get type of relation. |
Table |
getTable()
Get table that holds foreign key. |
int |
hashCode()
|
void |
merge(ForeignKey fk)
Check if given foreign key can be merged with this one. |
protected void |
referencedFieldNames(DDLWriter writer)
Concatenate all referenced field names delimited by field delimiter and whitespace. |
void |
setReferenceTable(Table table)
Set table referenced by the foreign key. |
void |
setRelationType(int relationType)
Set type of relation. |
void |
setTable(Table table)
Set table that holds foreign key. |
void |
toDropDDL(DDLWriter writer)
Build drop script for the schema object. |
Methods inherited from class org.castor.ddlgen.schemaobject.AbstractSchemaObject |
---|
equals, getConfiguration, getName, setConfiguration, setName |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.castor.ddlgen.schemaobject.SchemaObject |
---|
toCreateDDL |
Field Detail |
---|
public static final int ONE_ONE
public static final int ONE_MANY
public static final int MANY_MANY
Constructor Detail |
---|
public ForeignKey()
Method Detail |
---|
public final void setRelationType(int relationType)
relationType
- Type of relation.public final int getRelationType()
public final void addReferenceField(Field field)
field
- Field to add to list of fields referenced by the foreign key.public final int getReferenceFieldCount()
public final Field getReferenceField(int index)
index
- Index of referenced field to return.
public final void setReferenceTable(Table table)
table
- Table referenced by the foreign key.public final Table getReferenceTable()
public final void addField(Field field)
field
- Field to add to list of foreign key fields.public final int getFieldCount()
public final Field getField(int index)
index
- Index of foreign key field to return.
public final void setTable(Table table)
table
- Table that holds foreign key.public final Table getTable()
protected final void fieldNames(DDLWriter writer)
writer
- DDLWriter to write schema objects to.protected final void referencedFieldNames(DDLWriter writer)
writer
- DDLWriter to write schema objects to.public final void toDropDDL(DDLWriter writer)
writer
- DDLWriter to write schema objects to.public final void merge(ForeignKey fk) throws GeneratorException
fk
- Foreign key to check if it is able to be merged.
GeneratorException
- If foreign keys cannot be merged.public final boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |