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 ClassesModifier and TypeInterfaceDescriptionstatic final recordThe pinned relationship collections and Model types examined without materializing intermediate values. -
Method Summary
Modifier and TypeMethodDescriptionloadAncestorGraph(String modelId, Class<?> modelType, Class<A> ancestorType, io.fluxzero.common.api.modeling.ModelReadBoundary boundary) Resolves and loads only the closest ancestor assignable toancestorTypeat the graph's read boundary.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.loadAncestorGraphs(String modelId, Class<?> modelType, Class<A> ancestorType, io.fluxzero.common.api.modeling.ModelReadBoundary boundary) Resolves every reachable ancestor assignable toancestorTypeat 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 toancestorTypeat 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 toancestorTypeat 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.
-