Module is.codion.framework.domain
Interface ForeignKey
- All Superinterfaces:
Attribute<Entity>
,ForeignKeyCondition.Factory
An
Attribute
representing a foreign key relation.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
ProvidesForeignKeyDefinition.Builder
instances.static interface
Represents a foreign key reference between columns.Nested classes/interfaces inherited from interface is.codion.framework.domain.entity.attribute.Attribute
Attribute.AttributeDefiner<T>, Attribute.Type<T>
-
Method Summary
Modifier and TypeMethodDescriptiondefine()
static ForeignKey
foreignKey
(EntityType entityType, String name, List<ForeignKey.Reference<?>> references) Creates a newForeignKey
based on the given entityType and references.<T> ForeignKey.Reference<T>
static <T> ForeignKey.Reference<T>
Returns a newForeignKey.Reference
based on the given columns.Methods inherited from interface is.codion.framework.domain.entity.attribute.Attribute
entityType, name, type
Methods inherited from interface is.codion.framework.domain.entity.condition.ForeignKeyCondition.Factory
equalTo, in, in, isNotNull, isNull, notEqualTo, notIn, notIn
-
Method Details
-
define
ForeignKey.ForeignKeyDefiner define()- Specified by:
define
in interfaceAttribute<Entity>
- Returns:
- a
ForeignKey.ForeignKeyDefiner
for this foreign key
-
referencedType
EntityType referencedType()- Returns:
- the entity type referenced by this foreign key
-
references
List<ForeignKey.Reference<?>> references()- Returns:
- the
ForeignKey.Reference
s that comprise this key
-
reference
- Type Parameters:
T
- the column type- Parameters:
column
- the column- Returns:
- the reference that is based on the given column
-
reference
Returns a newForeignKey.Reference
based on the given columns.- Type Parameters:
T
- the column type- Parameters:
column
- the local columnforeign
- the referenced foreign column- Returns:
- a new
ForeignKey.Reference
based on the given columns
-
foreignKey
static ForeignKey foreignKey(EntityType entityType, String name, List<ForeignKey.Reference<?>> references) Creates a newForeignKey
based on the given entityType and references.- Parameters:
entityType
- the entityType owning this foreign keyname
- the attribute namereferences
- the references- Returns:
- a new
ForeignKey
- See Also:
-