コード例 #1
0
        protected internal virtual void AppendFields(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)
        {
            sb.Append(" ");
            string aliasString = null;
            string valueString = null;
            bool   started     = false;

            if (o.CountFields() == 0)
            {
                sb.Append("...");
            }
            else
            {
                //            PersistenceStore persistenceStore = context.getPersistenceStore();
                for (int i = 0; i < o.CountFields(); i++)
                {
                    Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledQueryField        fi = o.GetField(i);
                    Net.Vpc.Upa.Impl.Uql.Compiledexpression.DefaultCompiledExpression e  = fi.GetExpression();
                    bool fieldIsSelect = e is Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledSelect;
                    valueString = sqlManager.GetSQL(e, context, declarations);
                    if (fieldIsSelect)
                    {
                        valueString = "(" + valueString + ")";
                    }
                    aliasString = fi.GetAlias();
                    if (started)
                    {
                        sb.Append(",");
                    }
                    else
                    {
                        started = true;
                    }
                    if (aliasString == null)
                    {
                        sb.Append(valueString);
                    }
                    else
                    {
                        sb.Append(valueString);
                        sb.Append(" ");
                        sb.Append(sqlManager.GetSQL(new Net.Vpc.Upa.Impl.Uql.Compiledexpression.CompiledVar(aliasString), context, declarations));
                    }
                }
            }
        }