Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Issues List »

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

Anupam M (JIRA)

2010-09-02


Author LoginPost Reply

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

Dhiego Tosatti commented on HHH-1689:
-------------------------------------

Do not exist as dynamic query, you must create a formula within the file mapping hbm.xml. As in the example:
<property name="xxx" type="java.lang.Long" update="false" insert="false">
       <formula>
        (Select max (a.cod) from the table WHERE a.cod = field_mapping)
       </ formula>
    </ Property>

Created by: CTIC - UNOESC JOAƇABA - SC - BRAZIL

> unexpected AST node: query -- CASE WHEN THEN subquery
> -----------------------------------------------------
>
>           Key: HHH-1689
>           URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1689
>         Project: Hibernate Core
>       Issue Type: Bug
>       Components: query-sql
>      Environment: Hibernate 3.x
> Oracle 9.2.0
>        Reporter: Alejandro Torras
>  Original Estimate: 20h
> Remaining Estimate: 20h
>
> 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

   

_______________________________________________
hibernate-issues mailing list
hibernate-issues@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-issues
©2008 gg3721.com - Jax Systems, LLC, U.S.A.