i have trouble when using having clause at mysql 3.23...
hibernate translate hql into sql and adding aliases for all fields in query. in having clause hibernate uses filed names instead aliases.
but mysql 3.23 not work when access field with alias. in sql:
this not works
select traffic0_.SrcIp as x0_0_, sum(traffic0_.DataAll) as x1_0_ from traffic traffic0_ group by traffic0_.SrcIp having (traffic0_.SrcIp like '217.71.138.%' )
this works:
select traffic0_.SrcIp, sum(traffic0_.DataAll) as x1_0_ from traffic traffic0_ group by traffic0_.SrcIp having (traffic0_.SrcIp like '217.71.138.%' )
and this works too:
select traffic0_.SrcIp as x0_0_, sum(traffic0_.DataAll) as x1_0_ from traffic traffic0_ group by traffic0_.SrcIp having (traffic0_.x0_0_ like '217.71.138.%' )
any ideas how to fix it?
Hibernate version: 2.1.41
Full stack trace of any exception that occurs:
Name and version of the database you are using: mySql 3.23
The generated SQL (show_sql=true): select traffic0_.SrcIp as x0_0_, sum(traffic0_.DataAll) as x1_0_ from traffic traffic0_ group by traffic0_.SrcIp having (traffic0_.SrcIp like '217.71.138.%' )
|