private static List<ICallgraphEdge> loadEdges(final CConnection connection,final int callgraphId,final Map<Integer,CCallgraphNode> nodeMap) throws SQLException {
  final List<ICallgraphEdge> edges=new ArrayList<ICallgraphEdge>();
  final String edgeQuery="SELECT source_node_id, target_node_id" + " FROM " + CTableNames.NODES_TABLE + " JOIN "+ CTableNames.EDGES_TABLE+ " ON "+ CTableNames.NODES_TABLE+ ".id = "+ CTableNames.EDGES_TABLE+ ".source_node_id"+ " WHERE view_id = "+ callgraphId;
  final ResultSet edgeResult=connection.executeQuery(edgeQuery,true);
  try {
    while (edgeResult.next()) {
      final CCallgraphNode source=nodeMap.get(edgeResult.getInt("source_node_id"));
      final CCallgraphNode target=nodeMap.get(edgeResult.getInt("target_node_id"));
      CCallgraphNode.link(source,target);
      edges.add(new CCallgraphEdge(source,target));
    }
  }
  finally {
    edgeResult.close();
  }
  return edges;
}

private static List < ICallgraphEdge > loadEdges ( final CConnection connection , final int callgraphId , final Map < Integer , CCallgraphNode > nodeMap ) throws SQLException { final List < ICallgraphEdge > edges = new ArrayList < ICallgraphEdge > ( ) ; final String edgeQuery = "SELECT source_node_id, target_node_id" + " FROM " + CTableNames . NODES_TABLE + " JOIN " + CTableNames . EDGES_TABLE + " ON " + CTableNames . NODES_TABLE + ".id = " + CTableNames . EDGES_TABLE + ".source_node_id" + " WHERE view_id = " + callgraphId ; final ResultSet edgeResult = connection . executeQuery ( edgeQuery , true ) ; try { while ( edgeResult . next ( ) ) { final CCallgraphNode source = nodeMap . get ( edgeResult . getInt ( "source_node_id" ) ) ; final CCallgraphNode target = nodeMap . get ( edgeResult . getInt ( "target_node_id" ) ) ; CCallgraphNode . link ( source , target ) ; edges . add ( new CCallgraphEdge ( source , target ) ) ; } } finally { edgeResult . close ( ) ; } return edges ; }
loads the edges of the call graph . the call graph id and all call graph nodes must refer to objects stored in the database connected to by the connection argument .
