JPQL operator "is empty" failes for @ElementCollection
------------------------------------------------------
Key: HHH-6686
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6686
Project: Hibernate Core
Issue Type: Bug
Components: entity-manager
Affects Versions: 4.0.0.CR3
Environment: hibernate-entitymanager:4.0.0.CR3, mysql-connector-java:5.0.5
Reporter: Dirk weil
Attachments: Employee.java, QueryTester.java
The JPQL "select e from Employee e where e.skills is not empty" failes with the
exception
Exception in thread "main" java.lang.IllegalArgumentException:
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree [select e
from de.gedoplan.buch.eedemos.entity.Employee e where e.skills is not empty ]
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1334)
at
org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1280)
at
org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:283)
at de.gedoplan.buch.eedemos.entity.QueryTester.main(QueryTester.java:19)
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree
[select e from de.gedoplan.buch.eedemos.entity.Employee e where e.skills is not empty ]
at
org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:53)
at
org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:46)
at org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:79)
at
org.hibernate.hql.internal.ast.QueryTranslatorImpl.generate(QueryTranslatorImpl.java:238)
at
org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:203)
at
org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at
org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:120)
at
org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:214)
at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:192)
at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1538)
at
org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:280)
... 1 more
The attribute skills used in the where clause is a simple @ElementCollection
List<String>.
Attached files are the entity class (Employee.java) and a short main programm for
executing JPQL (QueryTester.java).
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira