Module is.codion.framework.domain
Interface EntityDefinition.ForeignKeys
- Enclosing interface:
- EntityDefinition
public static interface EntityDefinition.ForeignKeys
Holds the foreign key definitions for an entity type
-
Method Summary
Modifier and TypeMethodDescriptiondefinition
(ForeignKey foreignKey) definitions
(Column<T> column) boolean
foreignKeyColumn
(Column<?> column) get()
get
(EntityType referencedEntityType) Returns the foreign keys referencing entities of the given typereferencedBy
(ForeignKey foreignKey) Returns theEntityDefinition
of the entity referenced by the given foreign key.boolean
updatable
(ForeignKey foreignKey)
-
Method Details
-
definitions
Collection<ForeignKeyDefinition> definitions()- Returns:
- a list containing the foreign key definitions for this entity type
-
get
Collection<ForeignKey> get()- Returns:
- all foreign keys for this entity type
-
referencedBy
Returns theEntityDefinition
of the entity referenced by the given foreign key.- Parameters:
foreignKey
- the foreign key- Returns:
- the definition of the referenced entity
-
updatable
- Parameters:
foreignKey
- the foreign key- Returns:
- true if all the underlying columns are updatable
-
foreignKeyColumn
- Parameters:
column
- the column- Returns:
- true if the given column is part of a foreign key
-
get
Returns the foreign keys referencing entities of the given type- Parameters:
referencedEntityType
- the referenced entity type- Returns:
- the foreign keys referencing the given entity type, an empty collection is returned in case no foreign keys are found
-
definition
- Parameters:
foreignKey
- the foreign key- Returns:
- the ForeignKeyDefinition for the given foreign key
- Throws:
IllegalArgumentException
- in case no such foreign key exists
-
definitions
- Type Parameters:
T
- the attribute type- Parameters:
column
- the column- Returns:
- the ForeignKeyDefinitions associated with the given column, an empty collection in case none are found
-