[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1689) unexpected AST node: query -- CASE WHEN THEN subquery

Anupam M (JIRA) noreply at atlassian.com
Wed Dec 12 02:18:56 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1689?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29137 ] 

Anupam M commented on HHH-1689:
-------------------------------

The following portion is giving error:
if the internal query is replaced by static data , the query works fine.

case when p.lastValue in (select st.statusId from StatusType st where st.indicator = 'RED') then 'RED' else 'GREEN' end) 

> unexpected AST node: query -- CASE WHEN THEN subquery
> -----------------------------------------------------
>
>                 Key: HHH-1689
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1689
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: query-sql
>         Environment: Hibernate 3.x
> Oracle 9.2.0
>            Reporter: Alejandro Torras
>   Original Estimate: 2 days, 4 hours
>  Remaining Estimate: 2 days, 4 hours
>
> Hello,
> I got a <<org.hibernate.hql.ast.QuerySyntaxError: unexpected AST node: query [ >> exception with the following query:
> 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
> It seems that the THEN clause doesn't expect a query that Oracle 9.2 handles properly.
> Regards,
> Alejandro Torras.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list