Record Class EntityMetadata.ParentReference

java.lang.Object
java.lang.Record
io.fluxzero.sdk.modeling.EntityMetadata.ParentReference
Record Components:
pathInParent - optional parent-relative automatic composition path
parentModelTypes - inferred or explicitly declared possible parent model types; empty for an untyped ID
apiDoc - optional documentation for the list-valued automatic composition path
deleteOnParentDeletion - whether deletion of this parent owns the child lifecycle
Enclosing class:
EntityMetadata

public static record EntityMetadata.ParentReference(EntityMetadata.Property property, String pathInParent, List<Class<?>> parentModelTypes, ApiDoc apiDoc, boolean deleteOnParentDeletion) extends Record
One outgoing parent relationship declared by a child model.
  • Constructor Details

    • ParentReference

      public ParentReference(EntityMetadata.Property property, String pathInParent, List<Class<?>> parentModelTypes, ApiDoc apiDoc, boolean deleteOnParentDeletion)
      Creates an instance of a ParentReference record class.
      Parameters:
      property - the value for the property record component
      pathInParent - the value for the pathInParent record component
      parentModelTypes - the value for the parentModelTypes record component
      apiDoc - the value for the apiDoc record component
      deleteOnParentDeletion - the value for the deleteOnParentDeletion record component
  • Method Details

    • read

      public Object read(Object target)
    • parentModelType

      public Class<?> parentModelType()
      Returns the statically unique parent type, or null for untyped and polymorphic references.
    • supports

      public boolean supports(Class<?> parentType)
      Returns whether this reference can point to the supplied parent model type.
    • parentModelType

      public Class<?> parentModelType(Object parentId)
      Resolves the concrete parent model type for one runtime parent ID.
    • repositoryId

      public String repositoryId(Object parentId)
      Returns the parent's exact persisted identity for a functional parent ID value.
    • automaticallyComposed

      public boolean automaticallyComposed()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • property

      public EntityMetadata.Property property()
      Returns the value of the property record component.
      Returns:
      the value of the property record component
    • pathInParent

      public String pathInParent()
      Returns the value of the pathInParent record component.
      Returns:
      the value of the pathInParent record component
    • parentModelTypes

      public List<Class<?>> parentModelTypes()
      Returns the value of the parentModelTypes record component.
      Returns:
      the value of the parentModelTypes record component
    • apiDoc

      public ApiDoc apiDoc()
      Returns the value of the apiDoc record component.
      Returns:
      the value of the apiDoc record component
    • deleteOnParentDeletion

      public boolean deleteOnParentDeletion()
      Returns the value of the deleteOnParentDeletion record component.
      Returns:
      the value of the deleteOnParentDeletion record component