Record Class EntityMetadata.ParentReference

java.lang.Object
java.lang.Record
io.fluxzero.sdk.modeling.EntityMetadata.ParentReference
Record Components:
idType - scalar ID type, or the resolved collection element type
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
propagateSearch - whether ancestor search composition may traverse this edge
validateAncestors - whether cascading assertions may traverse this parent route
maxChildren - maximum children of this Model type and path, or -1 for unlimited
required - whether at least one existing parent is required
preventParentDeletion - whether surviving children block logical parent deletion
Enclosing class:
EntityMetadata

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

    • ParentReference

      public ParentReference(EntityMetadata.Property property, Class<?> idType, String pathInParent, List<Class<?>> parentModelTypes, ApiDoc apiDoc, boolean deleteOnParentDeletion, boolean propagateSearch, boolean validateAncestors, int maxChildren, boolean required, boolean preventParentDeletion)
      Creates an instance of a ParentReference record class.
      Parameters:
      property - the value for the property record component
      idType - the value for the idType 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
      propagateSearch - the value for the propagateSearch record component
      validateAncestors - the value for the validateAncestors record component
      maxChildren - the value for the maxChildren record component
      required - the value for the required record component
      preventParentDeletion - the value for the preventParentDeletion record component
  • Method Details

    • read

      public Object read(Object target)
      Reads the parent-reference value from the supplied target.
    • readIds

      public Collection<?> readIds(Object target)
      Reads distinct scalar parent IDs; a null property or empty collection has no parents.
    • 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()
      Returns whether a non-empty path in the parent enables automatic Graph composition for this reference.
    • propagatesSearch

      public boolean propagatesSearch()
      Whether this edge participates in search composition and inherited search activation.
    • constrained

      public boolean constrained()
      Whether this reference declares any SDK-provided relationship check.
    • 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
    • idType

      public Class<?> idType()
      Returns the value of the idType record component.
      Returns:
      the value of the idType 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
    • propagateSearch

      public boolean propagateSearch()
      Returns the value of the propagateSearch record component.
      Returns:
      the value of the propagateSearch record component
    • validateAncestors

      public boolean validateAncestors()
      Returns the value of the validateAncestors record component.
      Returns:
      the value of the validateAncestors record component
    • maxChildren

      public int maxChildren()
      Returns the value of the maxChildren record component.
      Returns:
      the value of the maxChildren record component
    • required

      public boolean required()
      Returns the value of the required record component.
      Returns:
      the value of the required record component
    • preventParentDeletion

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