Module is.codion.framework.domain
Interface ForeignKey
- All Superinterfaces:
Attribute<Entity>,ForeignKeyCondition.Factory
An
Attribute representing a foreign key relation.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceProvidesForeignKeyDefinition.Builderinstances.static interfaceRepresents 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 ForeignKeyforeignKey(EntityType entityType, String name, List<ForeignKey.Reference<?>> references) Creates a newForeignKeybased on the given entityType and references.<T> ForeignKey.Reference<T>static <T> ForeignKey.Reference<T>Returns a newForeignKey.Referencebased on the given columns.Methods inherited from interface is.codion.framework.domain.entity.attribute.Attribute
entityType, name, typeMethods 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:
definein interfaceAttribute<Entity>- Returns:
- a
ForeignKey.ForeignKeyDefinerfor this foreign key
-
referencedType
EntityType referencedType()- Returns:
- the entity type referenced by this foreign key
-
references
List<ForeignKey.Reference<?>> references()- Returns:
- the
ForeignKey.References 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.Referencebased on the given columns.- Type Parameters:
T- the column type- Parameters:
column- the local columnforeign- the referenced foreign column- Returns:
- a new
ForeignKey.Referencebased on the given columns
-
foreignKey
static ForeignKey foreignKey(EntityType entityType, String name, List<ForeignKey.Reference<?>> references) Creates a newForeignKeybased 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:
-