Hi, Hibernate gurus
I have problem of order by clase in HQL.
It seems the following HQL dosen't work:
Code:
select a from com.erry.model.sales.SalesCheckoutBill as a where ... order by a.client.code
It translates to sql statment like :
Code:
select a.ID, a.code,..._clt.ID from T_CHK_OUT_BILL a, T_CLIENT _clt.ID ... order by _clt.CODE
whose select clause doesn't contain the order by column.
And the result is not what we want, it doesn't order properly.
But, if I include the order by column in HQL like:
select a from com.erry.model.sales.SalesCheckoutBill as a, a.client.code where ... order by a.client.code
it works!
What's wrong? Any workaround?
Regards,
Justin