Пример #1
0
        private ResultInfoList GetResultInfoList(
            Dictionary <string, IEnumerable <Tuple <string, bool> > > tableColumnNamesList
            , ResultInfoAST.PrimaryKeyCompletion primaryKeyCompletion = ResultInfoAST.PrimaryKeyCompletion.None)
        {
            var stmt = this.GetStmt();

            // SELECT文以外は処理の対象外である
            if (stmt.Type != StmtType.Select)
            {
                return(new ResultInfoList());
            }

            // ResultInfoASTに渡すためのテーブル列情報を作成する
            var tableColumns = new Dictionary <string, IEnumerable <TableResultInfo> >();

            foreach (var tableColumnNames in tableColumnNamesList)
            {
                var tableName           = tableColumnNames.Key;
                var tableResultInfoList = new List <TableResultInfo>();
                foreach (var tableColumnName in tableColumnNames.Value)
                {
                    var isPrimaryKey    = tableColumnName.Item2;
                    var tableResultInfo = new TableResultInfo(tableName, tableColumnName.Item1, !isPrimaryKey, isPrimaryKey);
                    tableResultInfoList.Add(tableResultInfo);
                }
                tableColumns.Add(tableName, tableResultInfoList);
            }
            // SELECT句の解析を行う
            var resultInfoAST = new ResultInfoAST((SelectStmt)stmt, tableColumns, primaryKeyCompletion);

            return(resultInfoAST.GetResultInfoList());
        }
Пример #2
0
        public TableResultInfo Clone()
        {
            var ret = new TableResultInfo(this.ServerName
                                          , this.DataBaseName
                                          , this.SchemaName
                                          , this.TableName
                                          , this.ColumnAliasName
                                          , this.IsNullable
                                          , this.KeyType == KeyType.Table);

            //, this.IsUnique);
            ret.TableAliasName = this.TableAliasName;
            ret.IsReferenced   = this.IsReferenced;
            ret.SourceTable    = this.SourceTable;
            return(ret);
        }
Пример #3
0
 virtual public void VisitBefore(TableResultInfo resultInfo)
 {
 }
Пример #4
0
 virtual public void VisitAfter(TableResultInfo resultInfo)
 {
 }