The request is to allow the use of subqueries as CASE alternatives in HQL.
---- h2. Original Description
Hello,
I got a << {{ org.hibernate.hql.ast.QuerySyntaxError: unexpected AST node: query [ >> }} exception with the following query:
{code} FROM t1 AS vo, t2 AS vo2 WHERE vo2.indIdiomaSistema = 'S' AND vo.id.codiIdioma.id = :id_codiIdioma_id GROUP BY vo.id.codiTipusIdent.id HAVING COUNT(*) BETWEEN CASE :estat WHEN '1' THEN (SELECT COUNT(*) FROM t2 WHERE ind_idioma_sistema = 'S') ELSE 0 END AND 4 ORDER BY vo.nomTipusIdent asc {code} It seems that the THEN clause doesn't expect a query that Oracle 9.2 handles properly.
Regards, Alejandro Torras.
|