예제 #1
0
 public Net.Vpc.Upa.Expressions.Update AddQuery(Net.Vpc.Upa.Expressions.Update other)
 {
     if (other == null)
     {
         return(this);
     }
     if (other.entity != null)
     {
         entity = (Net.Vpc.Upa.Expressions.EntityName)other.entity.Copy();
     }
     if (other.entityAlias != null)
     {
         entityAlias = other.entityAlias;
     }
     for (int i = 0; i < (other.fields).Count; i++)
     {
         Set(other.GetField(i).GetName(), other.GetFieldValue(i));
     }
     if (other.condition != null)
     {
         if (condition == null)
         {
             condition = other.condition.Copy();
         }
         else
         {
             condition = new Net.Vpc.Upa.Expressions.And(condition, other.condition.Copy());
         }
     }
     return(this);
 }
 protected internal virtual Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledUpdate CompileUpdate(Net.Vpc.Upa.Expressions.Update v, Net.Vpc.Upa.Impl.Uql.ExpressionTranslationManager manager, Net.Vpc.Upa.Impl.Uql.ExpressionDeclarationList declarations)
 {
     if (v == null)
     {
         return(null);
     }
     Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledUpdate s = new Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledUpdate();
     s.Entity(v.GetEntity().GetName());
     Net.Vpc.Upa.Entity entity = manager.GetPersistenceUnit().GetEntity(v.GetEntity().GetName());
     for (int i = 0; i < v.CountFields(); i++)
     {
         Net.Vpc.Upa.Expressions.Var        fvar   = v.GetField(i);
         Net.Vpc.Upa.Expressions.Expression fvalue = v.GetFieldValue(i);
         s.Set(entity.GetField(fvar.GetName()), manager.TranslateAny(fvalue, declarations));
     }
     s.Where(manager.TranslateAny(v.GetCondition(), declarations));
     return(s);
 }