Interface ModelAncestorResolver

All Known Implementing Classes:
DefaultModelRepository

public interface ModelAncestorResolver
Optional repository capability for resolving a typed ancestor from relationship identities before loading model values. Graph uses this only for a detached, lazy graph node; repositories without this capability retain the ordinary parent-by-parent fallback.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    The pinned relationship collections and Model types examined without materializing intermediate values.
  • Method Summary

    Modifier and Type
    Method
    Description
    <A> Optional<Graph<A>>
    loadAncestorGraph(String modelId, Class<?> modelType, Class<A> ancestorType, io.fluxzero.common.api.modeling.ModelReadBoundary boundary)
    Resolves and loads only the closest ancestor assignable to ancestorType at the graph's read boundary.
    default <A> Optional<Graph<A>>
    loadAncestorGraph(String modelId, Class<?> modelType, Class<A> ancestorType, io.fluxzero.common.api.modeling.ModelReadBoundary boundary, Consumer<ModelAncestorResolver.AncestorReads> observer)
    Resolves an ancestor while reporting the identities inspected by the relationship traversal, including a negative result.
    default <A> List<Graph<A>>
    loadAncestorGraphs(String modelId, Class<?> modelType, Class<A> ancestorType, io.fluxzero.common.api.modeling.ModelReadBoundary boundary)
    Resolves every reachable ancestor assignable to ancestorType at one boundary.
  • Method Details

    • loadAncestorGraph

      <A> Optional<Graph<A>> loadAncestorGraph(String modelId, Class<?> modelType, Class<A> ancestorType, io.fluxzero.common.api.modeling.ModelReadBoundary boundary)
      Resolves and loads only the closest ancestor assignable to ancestorType at the graph's read boundary. Intermediate parent values must remain unloaded.
    • loadAncestorGraph

      default <A> Optional<Graph<A>> loadAncestorGraph(String modelId, Class<?> modelType, Class<A> ancestorType, io.fluxzero.common.api.modeling.ModelReadBoundary boundary, Consumer<ModelAncestorResolver.AncestorReads> observer)
      Resolves an ancestor while reporting the identities inspected by the relationship traversal, including a negative result. Implementations can override this to preserve identity-only traversal for transactional Graph reads. The default reports no proof; the Graph then gathers dependencies through its ordinary parents.
    • loadAncestorGraphs

      default <A> List<Graph<A>> loadAncestorGraphs(String modelId, Class<?> modelType, Class<A> ancestorType, io.fluxzero.common.api.modeling.ModelReadBoundary boundary)
      Resolves every reachable ancestor assignable to ancestorType at one boundary.

      The singular method remains the ergonomic default for normal graph traversal. Change subscriptions use this form because one changed model may be shared by multiple roots.