Hi,
recently I ran into an issue with a query that works fine on hibernate 4.2.x (4.2.0.SP1) but fails in 4.3.x (, here is the query:
Code:
select key.processInstanceId from org.jbpm.persistence.correlation.CorrelationKeyInfo key left join key.properties props where size(key.properties) = cast(:elem_count as integer) and props.value in :properties group by key.id,key.processInstanceId having count(key.id) = :elem_count
and the error reported is:
Code:
[QC] DEBUG [localhost-startStop-1] org.hibernate.internal.NamedQueryRepository.checkNamedQueries(159) | Checking named query: GetProcessInstanceIdByCorrelation
[QC] DEBUG [localhost-startStop-1] org.hibernate.hql.internal.ast.QueryTranslatorImpl.parse(294) | parse() - HQL: select key.processInstanceId from org.jbpm.persistence.correlation.CorrelationKeyInfo key left join key.properties props where size(key.properties) = cast(:elem_count as integer) and props.value in :properties group by key.id,key.processInstanceId having count(key.id) = :elem_count
[QC] DEBUG [localhost-startStop-1] org.hibernate.hql.internal.ast.ErrorCounter.reportWarning(89) | Keyword 'properties' is being interpreted as an identifier due to: expecting IDENT, found 'properties'
[QC] ERROR [localhost-startStop-1] org.hibernate.hql.internal.ast.ErrorCounter.reportError(78) | line 1:133: unexpected token: key
[QC] ERROR [localhost-startStop-1] org.hibernate.hql.internal.ast.ErrorCounter.reportError(73) | line 1:133: unexpected token: key
line 1:133: unexpected token: key
....
[QC] ERROR [localhost-startStop-1] org.hibernate.internal.SessionFactoryImpl.<init>(541) | HHH000177: Error in named query: GetProcessInstanceIdByCorrelation
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: key near line 1, column 133 [select key.processInstanceId from org.jbpm.persistence.correlation.CorrelationKeyInfo key left join key.properties props where size(key.properties) = cast(:elem_count as integer) and props.value in :properties group by key.id,key.processInstanceId having count(key.id) = :elem_count]
could it be because use of the "properties" in both field name and then parameter?
Thanks in advance for any hints
Maciej