Ejemplo n.º 1
0
 protected internal virtual void AppendFrom(Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledSelect o, System.Text.StringBuilder sb, Net.Vpc.Upa.Persistence.EntityExecutionContext context, Net.Vpc.Upa.Impl.Persistence.SQLManager sqlManager, Net.Vpc.Upa.Impl.Uql.ExpressionDeclarationList declarations)
 {
     Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledNameOrSelect entity = o.GetEntity();
     if (entity == null)
     {
         string fns = GetFromNullString();
         if (fns != null)
         {
             sb.Append(" ");
             sb.Append(fns);
         }
     }
     else
     {
         sb.Append(" From ");
         if (entity is Net.Vpc.Upa.Expressions.Select)
         {
             sb.Append(sqlManager.GetSQL(entity, context, declarations));
         }
         else
         {
             Net.Vpc.Upa.Persistence.PersistenceStore persistenceStore             = context.GetPersistenceStore();
             Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledEntityName entityName = (Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledEntityName)entity;
             Net.Vpc.Upa.Entity e = context.GetPersistenceUnit().GetEntity(entityName.GetName());
             if (entityName.IsUseView() && e.NeedsView() && persistenceStore.IsViewSupported())
             {
                 Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledEntityName v = new Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledEntityName(e.GetName(), true);
                 sb.Append(sqlManager.GetSQL(v, context, declarations));
             }
             else
             {
                 sb.Append(sqlManager.GetSQL(entityName, context, declarations));
             }
         }
     }
     if (o.GetEntityAlias() != null)
     {
         Net.Vpc.Upa.Persistence.PersistenceStore store = context.GetPersistenceStore();
         sb.Append(" ").Append(sqlManager.GetSQL(new Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar(o.GetEntityAlias()), context, declarations));
     }
 }