[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6913) QuerySyntaxException for valid JPQL query using the IN operator

Luis Fernando Planella Gonzalez (JIRA) noreply at atlassian.com
Wed Dec 21 09:14:23 EST 2011


QuerySyntaxException for valid JPQL query using the IN operator
---------------------------------------------------------------

                 Key: HHH-6913
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6913
             Project: Hibernate Core
          Issue Type: Bug
          Components: query-hql
    Affects Versions: 3.6.9
         Environment: Hibernate 3.6.9, MySQL 5.1 
            Reporter: Luis Fernando Planella Gonzalez


The following query, which is valid JPQL:
select person
from Person person
where person.id is not null and (person.category is null or person.category in :a1)

Generates the following error:
org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: {vector} [select person
from entities.Person person
where person.id is not null and (person.category is null or person.category in :a10_, :a11_)]

The in clause is not correct.
Note that if removing the 'person.id is not null and' part, the query works. Here is the working example:
select person
from Person person
where person.category is null or person.category in :a1

So, the closing parenthesis must be confusing the IN clause handling.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list