Package io.micronaut.data.model.runtime
Class RuntimeAssociation<T>
- java.lang.Object
-
- io.micronaut.data.model.runtime.RuntimePersistentProperty<T>
-
- io.micronaut.data.model.runtime.RuntimeAssociation<T>
-
- Type Parameters:
T
- the owning type
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider
,io.micronaut.core.annotation.AnnotationSource
,io.micronaut.core.naming.Named
,Association
,PersistentElement
,PersistentProperty
public class RuntimeAssociation<T> extends RuntimePersistentProperty<T> implements Association
A runtime representation ofAssociation
.- Since:
- 1.0
- Author:
- graemerocher
-
-
Field Summary
-
Fields inherited from class io.micronaut.data.model.runtime.RuntimePersistentProperty
EMPTY_PROPERTY_ARRAY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAliasName()
RuntimePersistentEntity<?>
getAssociatedEntity()
The associated entity if any.java.util.Optional<RuntimeAssociation<?>>
getInverseSide()
Retrieves the inverse side of the association.Relation.Kind
getKind()
boolean
isForeignKey()
boolean
isRequired()
Whether a property is required to be specified.-
Methods inherited from class io.micronaut.data.model.runtime.RuntimePersistentProperty
getAnnotationMetadata, getArgument, getConverter, getDataType, getName, getOwner, getPersistedName, getProperty, getType, getTypeName, isAssignable, isAssignable, isConstructorArgument, isEnum, isOptional, isReadOnly, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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.Association
doesCascade, getInversePathSide, isBidirectional
-
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
-
-
-
-
Method Detail
-
isForeignKey
public boolean isForeignKey()
- Specified by:
isForeignKey
in interfaceAssociation
- Returns:
- Whether the association is a foreign key association
-
getAliasName
public java.lang.String getAliasName()
- Specified by:
getAliasName
in interfaceAssociation
- Returns:
- The alias name representation.
-
getKind
@NonNull public Relation.Kind getKind()
- Specified by:
getKind
in interfaceAssociation
- Returns:
- The relationship kind
-
isRequired
public boolean isRequired()
Description copied from interface:PersistentProperty
Whether a property is required to be specified. This returns false if the property is both not nullable and not generated.- Specified by:
isRequired
in interfacePersistentProperty
- Returns:
- True if the property is required
- See Also:
PersistentProperty.isOptional()
,PersistentProperty.isGenerated()
-
getInverseSide
public java.util.Optional<RuntimeAssociation<?>> getInverseSide()
Description copied from interface:Association
Retrieves the inverse side of the association. If there is one.- Specified by:
getInverseSide
in interfaceAssociation
- Returns:
- The association.
-
getAssociatedEntity
@NonNull public RuntimePersistentEntity<?> getAssociatedEntity()
Description copied from interface:Association
The associated entity if any.- Specified by:
getAssociatedEntity
in interfaceAssociation
- Returns:
- The associated entity
-
-