Re: Expansions, projections and arrays

2009-08-27 Thread Sebastian Hennebrueder
Kalle Korhonen schrieb: 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 In that case, there is no other way. O

Re: Expansions, projections and arrays

2009-08-27 Thread Kalle Korhonen
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 wrote: > I

Re: Expansions, projections and arrays

2009-08-27 Thread Sebastian Hennebrueder
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 Hiber

Re: Expansions, projections and arrays

2009-08-26 Thread Kalle Korhonen
Almost brilliant! Except that if I have to write my own transformer or the bean from scratch, it's still more lines of code than just writing the getters for the template. There's no way to suppress the properties you've aliased (right?) but maybe I'll just use aliasToBean() and create a "Displayab

Re: Expansions, projections and arrays

2009-08-26 Thread Igor Drobiazko
You can set a ResultTransformer to your criteria. https://www.hibernate.org/hib_docs/v3/api/org/hibernate/transform/ResultTransformer.html On Thu, Aug 27, 2009 at 8:06 AM, Kalle Korhonen wrote: > I'm using tapestry-hibernate and I have a case where I'm forced to use > Projections (or aggregate f