[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1689?page=c...
]
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira