상속: WSqlFragment
예제 #1
0
        public override void Visit(WSqlBatch node)
        {
            for (int i = 0; i < node.Statements.Count; i++)
            {
                var statement = node.Statements[i];

                if (statement is WSelectStatement)
                {
                    var sqlSelect = statement as WSelectStatement;
                    node.Statements[i] = ConvertSqlSelectStatement(sqlSelect);
                }
                else if (statement is WInsertSpecification)
                {
                    var sqlInsert = statement as WInsertSpecification;
                    node.Statements[i] = ConvertSqlInsertStatement(sqlInsert);
                }
                else if (statement is WDeleteSpecification)
                {
                    var sqlDelete = statement as WDeleteSpecification;
                    node.Statements[i] = ConvertSqlDeleteStatement(sqlDelete);
                }
                else
                {
                    statement.Accept(this);
                }
            }
        }
        public override void Visit(WSqlBatch node)
        {
            for (int i = 0; i < node.Statements.Count; i++)
            {
                var statement = node.Statements[i];

                if (statement is WSelectStatement)
                {
                    var sqlSelect = statement as WSelectStatement;
                    node.Statements[i] = ConvertSqlSelectStatement(sqlSelect);
                }
                else if (statement is WInsertSpecification)
                {
                    var sqlInsert = statement as WInsertSpecification;
                    node.Statements[i] = ConvertSqlInsertStatement(sqlInsert);
                }
                else if (statement is WDeleteSpecification)
                {
                    var sqlDelete = statement as WDeleteSpecification;
                    node.Statements[i] = ConvertSqlDeleteStatement(sqlDelete);
                }
                else
                {
                    statement.Accept(this);
                }
            }
        }
예제 #3
0
        private WSqlFragment ConvertFragment(TSqlFragment fragment)
        {

            var tscript = fragment as TSqlScript;

            var wscript = new WSqlScript
            {
                FirstTokenIndex = tscript.FirstTokenIndex,
                LastTokenIndex = tscript.LastTokenIndex,
                Batches = tscript.Batches == null ? null : new List<WSqlBatch>(tscript.Batches.Count),
            };

            foreach (var tbatch in tscript.Batches)
            {
                var wbatch = new WSqlBatch
                {
                    FirstTokenIndex = tbatch.FirstTokenIndex,
                    LastTokenIndex = tbatch.LastTokenIndex,
                    Statements = new List<WSqlStatement>(tbatch.Statements.Count),
                };

                foreach (var wstat in tbatch.Statements.Select(ParseStatement))
                {
                    wbatch.Statements.Add(wstat);
                }

                wscript.Batches.Add(wbatch);
            }

            return wscript;
        }
예제 #4
0
 public virtual void Visit(WSqlBatch node)
 {
     node.AcceptChildren(this);
 }
 public override void Visit(WSqlBatch node)
 {
     base.Visit(node);
     node.Statements = Translate(node.Statements);
 }
예제 #6
0
 public virtual void Visit(WSqlBatch node)
 {
     node.AcceptChildren(this);
 }
예제 #7
0
 public override void Visit(WSqlBatch node)
 {
     base.Visit(node);
     ConvertToGraphModificationStatement(node.Statements);
 }
 public override void Visit(WSqlBatch node)
 {
     base.Visit(node);
     ConvertToGraphModificationStatement(node.Statements);
 }