/// <summary> /// Returns true if there are columns of a specific table referenced in a statement /// </summary> /// <param name="node">The query statement</param> /// <param name="tableName">the table for query</param> /// <param name="context">Sql context with table alias mapping</param> /// <param name="columnsOfNodeTables"></param> /// <param name="conn">A open Sql connection</param> /// <returns></returns> public bool Invoke(WSelectQueryBlock node, string tableName, WSqlTableContext context, Dictionary<Tuple<string, string>, Dictionary<string, NodeColumns>> columnsOfNodeTables) { _tableExists = false; _tableName = tableName; _tableRef = context[tableName] as WNamedTableReference; _columnTableMapping = context.GetColumnToAliasMapping(columnsOfNodeTables); node.Accept(this); return _tableExists; }
/// <summary> /// Returns true if there are columns of a specific table referenced in a statement /// </summary> /// <param name="node">The query statement</param> /// <param name="tableName">the table for query</param> /// <param name="context">Sql context with table alias mapping</param> /// <param name="columnsOfNodeTables"></param> /// <param name="conn">A open Sql connection</param> /// <returns></returns> public bool Invoke(WSelectQueryBlock node, string tableName, WSqlTableContext context, Dictionary <Tuple <string, string>, Dictionary <string, NodeColumns> > columnsOfNodeTables) { _tableExists = false; _tableName = tableName; _tableRef = context[tableName] as WNamedTableReference; _columnTableMapping = context.GetColumnToAliasMapping(columnsOfNodeTables); node.Accept(this); return(_tableExists); }
private void ConstructSelectGraph() { QueryGraph = GraphViewDocDBCommand.DocDB_ConstructGraph(SelectQueryBlock); NodeTable = QueryGraph.ConnectedSubGraphs[0].Nodes; var AttachPredicateVisitor = new AttachWhereClauseVisitor(); var TableContext = new WSqlTableContext(); var GraphMeta = new GraphMetaData(); var columnTableMapping = TableContext.GetColumnToAliasMapping(GraphMeta.ColumnsOfNodeTables); if (SelectQueryBlock != null) { AttachPredicateVisitor.Invoke(SelectQueryBlock.WhereClause, QueryGraph, columnTableMapping); } int GroupNumber = 0; foreach (var node in NodeTable) { GraphViewDocDBCommand.GetQuery(node.Value); if (!GraphDescription.ContainsKey(node.Value.NodeAlias)) { GraphDescription[node.Value.NodeAlias] = ++GroupNumber; } } }