Class DepcyGraph

java.lang.Object
org.pgcodekeeper.core.model.graph.DepcyGraph

public final class DepcyGraph extends Object
Database dependency graph for managing object relationships and dependencies. Builds directed graph of database objects with support for cycle detection and resolution. Handles foreign key relationships, inheritance, and partitioning dependencies.
  • Constructor Details

    • DepcyGraph

      public DepcyGraph(IDatabase graphSrc)
      Creates a dependency graph from the database schema.
      Parameters:
      graphSrc - the source database to build graph from
    • DepcyGraph

      public DepcyGraph(IDatabase graphSrc, boolean reduceGraph)
      Creates a dependency graph with optional graph reduction.
      Parameters:
      graphSrc - the source database to build graph from
      reduceGraph - if true, merge column nodes into table nodes
  • Method Details

    • getGraph

      public org.jgrapht.Graph<IStatement,org.jgrapht.graph.DefaultEdge> getGraph()
      Gets the dependency graph. Graph direction: dependent object → dependency (source → target)
      Returns:
      the dependency graph
    • getReversedGraph

      public org.jgrapht.graph.EdgeReversedGraph<IStatement,org.jgrapht.graph.DefaultEdge> getReversedGraph()
    • getDb

      public IDatabase getDb()
      Copied database, graph source.
      Do not modify any elements in this as it will break HashSets/HashMaps and with them the generated graph.
    • addCustomDepcies

      public void addCustomDepcies(List<Map.Entry<IStatement,IStatement>> depcies)
      Adds custom dependencies to the graph.
      Parameters:
      depcies - list of custom dependency pairs to add