Inheritance: WUpdateDeleteSpecificationBase
コード例 #1
0
 public WDeleteNodeSpecification(WDeleteSpecification deleteSpec)
 {
     FirstTokenIndex = deleteSpec.FirstTokenIndex;
     LastTokenIndex  = deleteSpec.LastTokenIndex;
     TopRowFilter    = deleteSpec.TopRowFilter;
     Target          = deleteSpec.Target;
     WhereClause     = deleteSpec.WhereClause;
 }
コード例 #2
0
        private WSqlStatement ConvertSqlDeleteStatement(WDeleteSpecification sqlDeleteStatement)
        {
            if (_nodeCount >= _annotations.Count || sqlDeleteStatement.LastTokenIndex < _annotations[_nodeCount].Position)
            {
                return(sqlDeleteStatement);
            }

            if (_annotations[_nodeCount] is DeleteNodeAnnotation)
            {
                _nodeCount++;
                return(new WDeleteNodeSpecification(sqlDeleteStatement));
            }
            else
            {
                throw new GraphViewException("Cannot assign modification annotations back.");
            }
        }
コード例 #3
0
ファイル: WSqlParser.cs プロジェクト: Coword/GraphView
        private WSqlStatement ParseDeleteStatement(DeleteSpecification delSpec)
        {
            if (delSpec == null)
                return null;

            var wdelSpec = new WDeleteSpecification
            {
                Target = ParseTableReference(delSpec.Target),
                FirstTokenIndex = delSpec.FirstTokenIndex,
                LastTokenIndex = delSpec.LastTokenIndex
            };

            //From Clause
            if (delSpec.FromClause != null && delSpec.FromClause.TableReferences != null)
            {
                wdelSpec.FromClause = new WFromClause
                {
                    FirstTokenIndex = delSpec.FromClause.FirstTokenIndex,
                    LastTokenIndex = delSpec.FromClause.LastTokenIndex,
                    TableReferences = new List<WTableReference>(delSpec.FromClause.TableReferences.Count)
                };
                foreach (var pref in delSpec.FromClause.TableReferences.Select(ParseTableReference).Where(pref => pref != null))
                {
                    wdelSpec.FromClause.TableReferences.Add(pref);
                }
            }

            //where clause
            if (delSpec.WhereClause != null && delSpec.WhereClause.SearchCondition != null)
            {
                wdelSpec.WhereClause = new WWhereClause
                {
                    FirstTokenIndex = delSpec.WhereClause.FirstTokenIndex,
                    LastTokenIndex = delSpec.WhereClause.LastTokenIndex,
                    SearchCondition = ParseBooleanExpression(delSpec.WhereClause.SearchCondition)
                };
            }

            //top row filter
            if (delSpec.TopRowFilter != null)
            {
                wdelSpec.TopRowFilter = new WTopRowFilter
                {
                    Expression = ParseScalarExpression(delSpec.TopRowFilter.Expression),
                    Percent = delSpec.TopRowFilter.Percent,
                    WithTies = delSpec.TopRowFilter.WithTies,
                    FirstTokenIndex = delSpec.TopRowFilter.FirstTokenIndex,
                    LastTokenIndex = delSpec.TopRowFilter.LastTokenIndex
                };
            }

            return wdelSpec;
        }
コード例 #4
0
 public virtual void Visit(WDeleteSpecification node)
 {
     node.AcceptChildren(this);
 }
コード例 #5
0
 public virtual void Visit(WDeleteSpecification node)
 {
     node.AcceptChildren(this);
 }
コード例 #6
0
ファイル: WDataModification.cs プロジェクト: Coword/GraphView
 public WDeleteNodeSpecification(WDeleteSpecification deleteSpec)
 {
     FirstTokenIndex = deleteSpec.FirstTokenIndex;
     LastTokenIndex = deleteSpec.LastTokenIndex;
     TopRowFilter = deleteSpec.TopRowFilter;
     Target = deleteSpec.Target;
     WhereClause = deleteSpec.WhereClause;
 }
コード例 #7
0
        private WSqlStatement ConvertSqlDeleteStatement(WDeleteSpecification sqlDeleteStatement)
        {
            if (_nodeCount >= _annotations.Count || sqlDeleteStatement.LastTokenIndex < _annotations[_nodeCount].Position)
            {
                return sqlDeleteStatement;
            }

            if (_annotations[_nodeCount] is DeleteNodeAnnotation)
            {
                _nodeCount++;
                return new WDeleteNodeSpecification(sqlDeleteStatement);
            }
            else
            {
                throw new GraphViewException("Cannot assign modification annotations back.");
            }
        }