Package io.micronaut.data.model
Interface Association
-
- All Superinterfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider
,io.micronaut.core.annotation.AnnotationSource
,io.micronaut.core.naming.Named
,PersistentElement
,PersistentProperty
- All Known Subinterfaces:
Embedded
- All Known Implementing Classes:
RuntimeAssociation
,SourceAssociation
public interface Association extends PersistentProperty
A property that represents an association.- Since:
- 1.0
- Author:
- graemerocher
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
doesCascade(Relation.Cascade... types)
Whether this association cascades the given types.default java.lang.String
getAliasName()
PersistentEntity
getAssociatedEntity()
The associated entity if any.default java.util.Optional<PersistentAssociationPath>
getInversePathSide()
Retrieves the inverse side path of the association.default java.util.Optional<? extends Association>
getInverseSide()
Retrieves the inverse side of the association.default Relation.Kind
getKind()
default boolean
isBidirectional()
Whether the relationship is bidirectional.default boolean
isForeignKey()
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
-
Methods inherited from interface io.micronaut.data.model.PersistentElement
getPersistedName
-
Methods inherited from interface io.micronaut.data.model.PersistentProperty
getCapitilizedName, getConverter, getDataType, getName, getOwner, getTypeName, isAssignable, isAssignable, isAutoPopulated, isConstructorArgument, isEnum, isGenerated, isOptional, isReadOnly, isRequired
-
-
-
-
Method Detail
-
getAliasName
default java.lang.String getAliasName()
- Returns:
- The alias name representation.
-
getAssociatedEntity
@NonNull PersistentEntity getAssociatedEntity()
The associated entity if any.- Returns:
- The associated entity
-
getInverseSide
default java.util.Optional<? extends Association> getInverseSide()
Retrieves the inverse side of the association. If there is one.- Returns:
- The association.
-
getInversePathSide
default java.util.Optional<PersistentAssociationPath> getInversePathSide()
Retrieves the inverse side path of the association. If there is one.- Returns:
- The association.
-
isBidirectional
default boolean isBidirectional()
Whether the relationship is bidirectional.- Returns:
- True if it is bidirectional.
-
getKind
@NonNull default Relation.Kind getKind()
- Returns:
- The relationship kind
-
isForeignKey
default boolean isForeignKey()
- Returns:
- Whether the association is a foreign key association
-
doesCascade
default boolean doesCascade(Relation.Cascade... types)
Whether this association cascades the given types.- Parameters:
types
- The types- Returns:
- True if it does, false otherwise.
-
-