release : last hibernate3 cvs (today)
I play with hql and group by and this query :
select substr(human.nickName,1,3),count(*)
from Human human
group by substr(human.nickName,1,3)
work with old parser, but doesn't work with new (AST) parser
I try next workaround in hql.g (line 332)
( "by"! expression ( COMMA! expression )* )?
except :
( "by"! path ( COMMA! path )* )?
and it work - query
select substr(human.name,1,3),count(*)
from Human human
group by substr(human.name,1,3)
work with new (AST) parser and my workaround , but doesn't work with old parser
(error is : path expression ends in a composite value: human0_.name [select substr(human.name,1,3),count(*)
from Human human
group by substr(human.name,1,3)]
Tests HQLTest return 14 failures and 1 error with and without my workaround.
test HqlParserTest is fine without my workaround and with return error :
HqlParserTest return error in test testPathologicalKeywordAsIdentifier
junit.framework.AssertionFailedError: At least one error occurred during parsing! expected:<0> but was:<2>
What I can do for query with sql functions in group by ?
regards
Peco
|