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
A property that represents an association.
- Since:
- 1.0
- Author:
- graemerocher
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.data.model.PersistentProperty
PersistentProperty.EnumConstant
-
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
doesCascade
(Relation.Cascade... types) Whether this association cascades the given types.default String
@NonNull PersistentEntity
The associated entity if any.default EnumSet<Relation.Cascade>
default Optional<PersistentAssociationPath>
Retrieves the inverse side path of the association.default Optional<? extends Association>
Retrieves the inverse side of the association.default Relation.Kind
getKind()
default boolean
default boolean
Whether the relationship is bidirectional.default boolean
default boolean
Determines whether this association is single-ended, meaning it only has one end point.Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getAnnotationMetadata, getTargetAnnotationMetadata, 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
getAlias, getCapitalizedName, getCapitilizedName, getConverter, getDataType, getEnumConstants, getJsonDataType, getName, getOwner, getTypeName, isAssignable, isAssignable, isAutoPopulated, isConstructorArgument, isEmbedded, isEnum, isGenerated, isOptional, isReadOnly, isRequired
-
Method Details
-
getAliasName
- Returns:
- The alias name representation.
-
hasDeclaredAliasName
default boolean hasDeclaredAliasName()- Returns:
- whether this Association has a declared alias name
- Since:
- 3.8
-
getAssociatedEntity
The associated entity if any.- Returns:
- The associated entity
-
getInverseSide
Retrieves the inverse side of the association. If there is one.- Returns:
- The association.
-
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
- Returns:
- The relationship kind
-
isForeignKey
default boolean isForeignKey()- Returns:
- Whether the association is a foreign key association
-
isSingleEnded
default boolean isSingleEnded()Determines whether this association is single-ended, meaning it only has one end point. An association is considered single-ended if its kind is either ONE_TO_ONE or MANY_TO_ONE, but not EMBEDDED.- Returns:
- True if the association is single-ended, false otherwise.
-
doesCascade
Whether this association cascades the given types.- Parameters:
types
- The types- Returns:
- True if it does, false otherwise.
-
getCascadeTypes
-