collection_valued_input_parameter not working in IN statement

Description

3.5.0-Beta1 of hibernate-entitymanager supports JPA 2.0.
According to section 4.6.9 of the JPA 2.0 spec an IN statement can have a collection_valued_input_parameter:

"
in_expression ::=
{state_field_path_expression | type_discriminator} [NOT] IN
{ ( in_item {, in_item}* ) | (subquery) | collection_valued_input_parameter }
in_item ::= literal | single_valued_input_parameter

"

When I try the following query:

SELECT DISTINCT Object(p) FROM org.freebxml.omar.jaxb.bindings.rim._4_0.PersonType p, org.freebxml.omar.jaxb.bindings.rim._4_0.AssociationType a WHERE a.sourceObject = :sourceObjectId AND p.id = a.targetObject AND a.type IN :typexxx

with a List<String> value for collection_valued_input_parameter :typexxx I get the following unexpected error:

Caused by: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: : near line 1, column 226 [SELECT DISTINCT Object(p) FROM org.freebxml.omar.jaxb.bindings.rim._4_0.PersonType p, org.freebxml.omar.jaxb.bindings.rim._4_0.AssociationType a WHERE a.sourceObject = :sourceObjectId AND p.id = a.targetObject AND a.type IN :typexxx ]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47)
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:284)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:182)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1585)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:121)

Environment

None

Activity

Show:
Steve Ebersole
March 21, 2011, 7:08 PM

Bulk closing stale resolved issues

Assignee

Gail Badner

Reporter

Farrukh Najmi

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure