public class ForeignKeyImpl extends Object implements ForeignKey, Comparable<ForeignKey>
| Constructor and Description |
|---|
ForeignKeyImpl(Entity referencingEntity,
Attribute referencingAttribute,
Entity referencedEntity,
Attribute referencedAttribute,
boolean composite)
Creates a foreign key.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(ForeignKey o) |
boolean |
equals(Object obj) |
Attribute |
getReferencedAttribute()
Gets the referenced attribute.
|
Entity |
getReferencedEntity()
Gets the referenced entity.
|
Entity |
getReferencedTableProvidingEntity()
Gets the entity that provides the table for the referenced entity.
|
Attribute |
getReferencingAttribute()
Gets the referencing attribute.
|
Entity |
getReferencingEntity()
Gets the referencing entity.
|
Entity |
getReferencingTableProvidingEntity()
Gets the entity that provides the table for the referencing entity.
|
int |
hashCode() |
boolean |
isComposite()
Returns whether the reference is via a composite relation.
|
void |
setComposite(boolean composite) |
String |
sqlCreateForeignKey(Backend backend)
Creates the foreign key creation sql code.
|
String |
toString() |
public ForeignKeyImpl(Entity referencingEntity, Attribute referencingAttribute, Entity referencedEntity, Attribute referencedAttribute, boolean composite)
referencingEntity - the referencing entityreferencingAttribute - the referenced entityreferencedEntity - the referenced entityreferencedAttribute - the referenced attributecomposite - true if cascade on delete and updatepublic int compareTo(ForeignKey o)
compareTo in interface Comparable<ForeignKey>public Entity getReferencingEntity()
ForeignKeygetReferencingEntity in interface ForeignKeypublic Attribute getReferencingAttribute()
ForeignKeygetReferencingAttribute in interface ForeignKeypublic Entity getReferencedEntity()
ForeignKeygetReferencedEntity in interface ForeignKeypublic Attribute getReferencedAttribute()
ForeignKeygetReferencedAttribute in interface ForeignKeypublic boolean isComposite()
ForeignKeyisComposite in interface ForeignKeypublic void setComposite(boolean composite)
public String sqlCreateForeignKey(Backend backend)
ForeignKeysqlCreateForeignKey in interface ForeignKeybackend - the backend to create sql code forpublic Entity getReferencingTableProvidingEntity()
ForeignKeygetReferencingTableProvidingEntity in interface ForeignKeypublic Entity getReferencedTableProvidingEntity()
ForeignKeygetReferencedTableProvidingEntity in interface ForeignKeyTentackle - a domain driven enterprise framework