Class JoinGraph

java.lang.Object
com.kingsrook.qqq.backend.core.actions.metadata.JoinGraph

public class JoinGraph extends Object
Represents the graph of table-to-table joins in a QQQ Instance, treating each join as a non-directional edge between two tables.

The primary purpose of this class is to answer the question: "given a starting table, what other tables can be reached through joins, and via which paths?" This is used during instance enrichment and validation to discover multi-hop join paths (e.g., order → orderLine → item).

Key behaviors:

  • Deduplication: If the instance defines both A → B and B → A joins (on the same fields), they are normalized into a single edge so the graph does not contain redundant paths.
  • Flipped-join awareness: Even though duplicate joins are collapsed into one edge, the flippedJoins map remembers all original join names for each table pair, so that JoinGraph.JoinConnectionList.matchesJoinPath(List, JoinGraph, QInstance) can match a path by any equivalent join name, not just the one stored in the edge.
  • Path-length limiting: To keep traversal performant on large instances, paths longer than maxPathLength (default 3) are pruned. This limit is configurable via the system property qqq.instance.joinGraph.maxPathLength or environment variable QQQ_INSTANCE_JOIN_GRAPH_MAX_PATH_LENGTH.