예제 #1
0
 protected DeleteCommandExpression UpdateDelete(DeleteCommandExpression delete, IdentifiableExpression table, Expression where)
 {
     if (table != delete.Identifiable || where != delete.Where)
     {
         return new DeleteCommandExpression(table, where);
     }
     return delete;
 }
예제 #2
0
 protected virtual Expression VisitDelete(DeleteCommandExpression delete)
 {
     var table = (IdentifiableExpression)this.Visit(delete.Identifiable);
     var where = this.Visit(delete.Where);
     return this.UpdateDelete(delete, table, where);
 }
예제 #3
0
            protected override Expression VisitDelete(DeleteCommandExpression delete)
            {
                if (delete.Identifiable.Entity.EntityType.Implements<IThing>())
                {
                    this.Write("DELETE Vertex ");
                }
                else if (delete.Identifiable.Entity.EntityType.Implements<IAssociation>())
                {
                    this.Write("DELETE Edge ");
                }
                else throw new NotSupportedException("Only Association and Thing types are supported.");

                bool saveHideIdentifiable = this.HideIdentifiableAliases;
                bool saveHideField = this.HideFieldAliases;
                this.HideIdentifiableAliases = true;
                this.HideFieldAliases = true;
                this.VisitSource(delete.Identifiable);
                if (delete.Where != null)
                {
                    this.WriteLine(Indentation.Same);
                    this.Write("WHERE ");
                    this.VisitPredicate(delete.Where);
                }
                this.HideIdentifiableAliases = saveHideIdentifiable;
                this.HideFieldAliases = saveHideField;
                return delete;
            }
예제 #4
0
 protected override Expression VisitDelete(DeleteCommandExpression delete)
 {
     this.Write("DELETE FROM ");
     bool saveHideIdentifiable = this.HideIdentifiableAliases;
     bool saveHideField = this.HideFieldAliases;
     this.HideIdentifiableAliases = true;
     this.HideFieldAliases = true;
     this.VisitSource(delete.Identifiable);
     if (delete.Where != null)
     {
         this.WriteLine(Indentation.Same);
         this.Write("WHERE ");
         this.VisitPredicate(delete.Where);
     }
     this.HideIdentifiableAliases = saveHideIdentifiable;
     this.HideFieldAliases = saveHideField;
     return delete;
 }
예제 #5
0
 protected virtual bool CompareDelete(DeleteCommandExpression x, DeleteCommandExpression y)
 {
     return this.Compare(x.Identifiable, y.Identifiable) && this.Compare(x.Where, y.Where);
 }