Sebastian, I appreciate the try. But I needed an avg of a field and
considering that I don't know how to write it in plain sql either
without the avg being used in the result, I think it cannot be done
with Criteria either.

Kalle


On Thu, Aug 27, 2009 at 1:38 AM, Sebastian
Hennebrueder<use...@laliluna.de> wrote:
> I am just hitting for the bonus.
>
> You don't need projections for ordering just order on a field. if the
> ordering takes place in a relation, then create an alias and use it in the
> order condition.
>
>
> Best Regards / Viele Grüße
>
> Sebastian Hennebrueder
> -----
> Software Developer and Trainer for Hibernate / Java Persistence
> http://www.laliluna.de
>
>
>
> Kalle Korhonen schrieb:
>>
>> I'm using tapestry-hibernate and I have a case where I'm forced to use
>> Projections (or aggregate functions in hql but same end result) so my
>> query is returning an object array. Now, I'm rendering a list of that
>> information to the user, but since using ${obj[0]} expansion is not
>> supported, I'm forced to write a getter for each synthetic property
>> (so I can refer to them with ${objProp1}, ${objProp2} etc.) I'm
>> displaying in my grid. It's not too bad, but is there a better way to
>> do this? (could do it with ognl, but I would like to avoid adding a
>> new dependency just for this).
>>
>> Kalle
>>
>> PS. Bonus points if you tell me how to make Hibernate return objects
>> with Criteria api if I only need projections for ordering the result
>> set.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to