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 of Association.
Since:
1.0
Author:
graemerocher
  • Method Details

    • isForeignKey

      public boolean isForeignKey()
      Specified by:
      isForeignKey in interface Association
      Returns:
      Whether the association is a foreign key association
    • isSingleEnded

      public boolean isSingleEnded()
      Description copied from interface: Association
      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.
      Specified by:
      isSingleEnded in interface Association
      Returns:
      True if the association is single-ended, false otherwise.
    • getAliasName

      public String getAliasName()
      Specified by:
      getAliasName in interface Association
      Returns:
      The alias name representation.
    • getKind

      @NonNull public Relation.Kind getKind()
      Specified by:
      getKind in interface Association
      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 interface PersistentProperty
      Returns:
      True if the property is required
      See Also:
    • getInverseSide

      public Optional<RuntimeAssociation<?>> getInverseSide()
      Description copied from interface: Association
      Retrieves the inverse side of the association. If there is one.
      Specified by:
      getInverseSide in interface Association
      Returns:
      The association.
    • getAssociatedEntity

      @NonNull public @NonNull RuntimePersistentEntity<?> getAssociatedEntity()
      Description copied from interface: Association
      The associated entity if any.
      Specified by:
      getAssociatedEntity in interface Association
      Returns:
      The associated entity