org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: {vector} [SELECT ed FROM de.company.project.model.ExternalDocument ed LEFT JOIN FETCH ed.documentType dt JOIN FETCH ed.company co WHERE co IN (:companies0_, :companies1_, :companies2_) AND (dt IS NULL OR dt IN :docTypes0_, :docTypes1_, :docTypes2_, :docTypes3_) ORDER BY ed.fileName]

Hibernate JIRA | Karsten Wutzke | 4 years ago
  1. 0

    I have the following JPQL: {code}SELECT ed FROM ExternalDocument ed LEFT JOIN FETCH ed.documentType dt JOIN FETCH ed.company co WHERE co IN :companies AND (dt IS NULL OR dt IN :docTypes) ORDER BY ed.fileName{code} Since AND binds tighter than OR the parentheses are mandatory. (:companies and :docTypes are both java.util.List) However, Hibernate fails with: {code}Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: {vector} [SELECT ed FROM de.company.project.model.ExternalDocument ed LEFT JOIN FETCH ed.documentType dt JOIN FETCH ed.company co WHERE co IN (:companies0_, :companies1_, :companies2_) AND (dt IS NULL OR dt IN :docTypes0_, :docTypes1_, :docTypes2_, :docTypes3_) ORDER BY ed.fileName] at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54) at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47) at org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:79) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:255) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:183) 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:119) at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:214) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1107) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:252) ... 154 more{code} You can see that the second IN :docTypes0_, :docTypes1_, :docTypes2_, :docTypes3_ expression is missing the parentheses.

    Hibernate JIRA | 4 years ago | Karsten Wutzke
    org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: {vector} [SELECT ed FROM de.company.project.model.ExternalDocument ed LEFT JOIN FETCH ed.documentType dt JOIN FETCH ed.company co WHERE co IN (:companies0_, :companies1_, :companies2_) AND (dt IS NULL OR dt IN :docTypes0_, :docTypes1_, :docTypes2_, :docTypes3_) ORDER BY ed.fileName]
  2. 0

    I have the following JPQL: {code}SELECT ed FROM ExternalDocument ed LEFT JOIN FETCH ed.documentType dt JOIN FETCH ed.company co WHERE co IN :companies AND (dt IS NULL OR dt IN :docTypes) ORDER BY ed.fileName{code} Since AND binds tighter than OR the parentheses are mandatory. (:companies and :docTypes are both java.util.List) However, Hibernate fails with: {code}Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: {vector} [SELECT ed FROM de.company.project.model.ExternalDocument ed LEFT JOIN FETCH ed.documentType dt JOIN FETCH ed.company co WHERE co IN (:companies0_, :companies1_, :companies2_) AND (dt IS NULL OR dt IN :docTypes0_, :docTypes1_, :docTypes2_, :docTypes3_) ORDER BY ed.fileName] at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54) at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47) at org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:79) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:255) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:183) 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:119) at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:214) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1107) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:252) ... 154 more{code} You can see that the second IN :docTypes0_, :docTypes1_, :docTypes2_, :docTypes3_ expression is missing the parentheses.

    Hibernate JIRA | 4 years ago | Karsten Wutzke
    org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected AST node: {vector} [SELECT ed FROM de.company.project.model.ExternalDocument ed LEFT JOIN FETCH ed.documentType dt JOIN FETCH ed.company co WHERE co IN (:companies0_, :companies1_, :companies2_) AND (dt IS NULL OR dt IN :docTypes0_, :docTypes1_, :docTypes2_, :docTypes3_) ORDER BY ed.fileName]
  3. 0

    5.1 Final Full Installer Ant Error On Mac

    wpthm.com | 1 year ago
    java.lang.RuntimeException: Operation failed
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Getting an exception while doing a search for an item

    GitHub | 7 months ago | ratneshp0
    java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree [select category from com.salesmanager.core.business.catalog.category.model.Category category left join fetch category.descriptions as categoryDescription left join fetch category.merchantStore where category.code in () and category.merchantStore.id = ?2 and categoryDescription.language.id = ?2 order by category.sortOrder asc, category.lineage asc, category.lineage asc, category.depth asc, categoryDescription.language.id desc]
  6. 0

    I do not see a customer registration or login link on the shop. Also Home appears twice, which looks like some shadow effect.

    Google Groups | 2 years ago | kaivalya apte
    org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree [select distinct p from com.salesmanager.core.business.user.model.Permission as p join fetch p.groups grous where grous.id in ()]

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.hql.internal.ast.QuerySyntaxException

      unexpected AST node: {vector} [SELECT ed FROM de.company.project.model.ExternalDocument ed LEFT JOIN FETCH ed.documentType dt JOIN FETCH ed.company co WHERE co IN (:companies0_, :companies1_, :companies2_) AND (dt IS NULL OR dt IN :docTypes0_, :docTypes1_, :docTypes2_, :docTypes3_) ORDER BY ed.fileName]

      at org.hibernate.hql.internal.ast.QuerySyntaxException.convert()
    2. Hibernate
      QueryImpl.list
      1. org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54)
      2. org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47)
      3. org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:79)
      4. org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:255)
      5. org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:183)
      6. org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
      7. org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
      8. org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
      9. org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:119)
      10. org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:214)
      11. org.hibernate.internal.SessionImpl.list(SessionImpl.java:1107)
      12. org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
      12 frames
    3. Hibernate EJB
      QueryImpl.getResultList
      1. org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:252)
      1 frame