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.
  • Method Details

    • loadAncestorGraph

      <A> Optional<Graph<A>> loadAncestorGraph(String modelId, Class<?> modelType, Class<A> ancestorType, 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, 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, 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.