- All Known Implementing Classes:
ForeignKeyImpl
public interface ForeignKey
Foreign key for referential integrity.
Because Tentackle references PDOs only by id there is only one attribute per foreign key.
- Author:
- harald
-
Method Summary
Modifier and TypeMethodDescriptionGets the referenced attribute.Gets the referenced entity.Gets the entity that provides the table for the referenced entity.Gets the referencing attribute.Gets the referencing entity.Gets the entity that provides the table for the referencing entity.booleanReturns whether the reference is via a composite relation.sqlCreateForeignKey(Backend backend) Creates the foreign key creation sql code.
-
Method Details
-
getReferencingEntity
Entity getReferencingEntity()Gets the referencing entity.- Returns:
- the referencing entity
-
getReferencingAttribute
Attribute getReferencingAttribute()Gets the referencing attribute.- Returns:
- the referencing attribute
-
getReferencedEntity
Entity getReferencedEntity()Gets the referenced entity.- Returns:
- the referenced entity
-
getReferencedAttribute
Attribute getReferencedAttribute()Gets the referenced attribute.- Returns:
- the referenced attribute
-
isComposite
boolean isComposite()Returns whether the reference is via a composite relation.- Returns:
- true if composite
-
sqlCreateForeignKey
Creates the foreign key creation sql code.- Parameters:
backend- the backend to create sql code for- Returns:
- the SQL code
-
getReferencingTableProvidingEntity
Entity getReferencingTableProvidingEntity()Gets the entity that provides the table for the referencing entity.- Returns:
- the entity, never null
-
getReferencedTableProvidingEntity
Entity getReferencedTableProvidingEntity()Gets the entity that provides the table for the referenced entity.- Returns:
- the entity, never null
-