private IQueryModel EnsureModel()
        {
            if (_model == null)
            {
                if (statement is SelectStatement stmt_sel)
                {
                    _model = QueryModelLoader.LoadModel(batchResolver, "roooot", stmt_sel.QueryExpression, stmt_sel.WithCtesAndXmlNamespaces);
                }
                else
                {
                    DataModificationSpecification source_specification = null;
                    DataModificationStatement     stmt_mod             = (DataModificationStatement)statement;
                    if (statement is InsertStatement stmt_ins)
                    {
                        source_specification = stmt_ins.InsertSpecification;
                    }
                    else if (statement is UpdateStatement stmt_upd)
                    {
                        source_specification = stmt_upd.UpdateSpecification;
                    }
                    else if (statement is DeleteStatement stmt_del)
                    {
                        source_specification = stmt_del.DeleteSpecification;
                    }
                    else if (statement is MergeStatement stmt_mrg)
                    {
                        source_specification = stmt_mrg.MergeSpecification;
                    }

                    _model = QueryModelLoader.LoadModificationOutputModel(batchResolver, "roooot", source_specification, stmt_mod.WithCtesAndXmlNamespaces);
                }
            }
            return(_model);
        }
 public override void ExplicitVisit(DataModificationStatement fragment)
 {
     _fragments.Add(fragment);
 }
 public sealed override void ExplicitVisit(DataModificationStatement node)
 {
     base.ExplicitVisit(node);
 }
Exemplo n.º 4
0
 private int GetColumnNumber(DataModificationStatement update)
 {
     return(update.StartLine == DynamicSqlStartLine
         ? update.StartColumn + DynamicSqlStartColumn
         : update.StartColumn);
 }
Exemplo n.º 5
0
 public override void ExplicitVisit(DataModificationStatement node) { this.action(node); }