org.hibernate.hql.ast.QuerySyntaxException: unexpected token: by near line 1, column 123 [from by.subpackage.subpackage.bean.Project upperP where upperP in (select p from by.subpackage.subpackage.bean.Project p, by.subpackage.subpackage.bean.ContractorService cs where p.service=cs.serviceId and p not in (select pc.projectId from by.subpackage.subpackage.bean.ProjectContractor pc where pc.contractor=cs.contractor) and p.projectStatus=1 and cs.contractor=? and p.address.zipCode in (?,?,?,?))]

Hibernate JIRA | Severyn Vital | 9 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    AST translator mixed up my business logic bean package name with one of it's reserved words: 'by'. Classic translator works fine with this hql. org.hibernate.hql.ast.QuerySyntaxException: unexpected token: by near line 1, column 123 [from by.subpackage.subpackage.bean.Project upperP where upperP in (select p from by.subpackage.subpackage.bean.Project p, by.subpackage.subpackage.bean.ContractorService cs where p.service=cs.serviceId and p not in (select pc.projectId from by.subpackage.subpackage.bean.ProjectContractor pc where pc.contractor=cs.contractor) and p.projectStatus=1 and cs.contractor=? and p.address.zipCode in (?,?,?,?))] at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31) at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24) at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:258) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)

    Hibernate JIRA | 9 years ago | Severyn Vital
    org.hibernate.hql.ast.QuerySyntaxException: unexpected token: by near line 1, column 123 [from by.subpackage.subpackage.bean.Project upperP where upperP in (select p from by.subpackage.subpackage.bean.Project p, by.subpackage.subpackage.bean.ContractorService cs where p.service=cs.serviceId and p not in (select pc.projectId from by.subpackage.subpackage.bean.ProjectContractor pc where pc.contractor=cs.contractor) and p.projectStatus=1 and cs.contractor=? and p.address.zipCode in (?,?,?,?))]
  2. 0

    AST translator mixed up my business logic bean package name with one of it's reserved words: 'by'. Classic translator works fine with this hql. org.hibernate.hql.ast.QuerySyntaxException: unexpected token: by near line 1, column 123 [from by.subpackage.subpackage.bean.Project upperP where upperP in (select p from by.subpackage.subpackage.bean.Project p, by.subpackage.subpackage.bean.ContractorService cs where p.service=cs.serviceId and p not in (select pc.projectId from by.subpackage.subpackage.bean.ProjectContractor pc where pc.contractor=cs.contractor) and p.projectStatus=1 and cs.contractor=? and p.address.zipCode in (?,?,?,?))] at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31) at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24) at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:258) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)

    Hibernate JIRA | 9 years ago | Severyn Vital
    org.hibernate.hql.ast.QuerySyntaxException: unexpected token: by near line 1, column 123 [from by.subpackage.subpackage.bean.Project upperP where upperP in (select p from by.subpackage.subpackage.bean.Project p, by.subpackage.subpackage.bean.ContractorService cs where p.service=cs.serviceId and p not in (select pc.projectId from by.subpackage.subpackage.bean.ProjectContractor pc where pc.contractor=cs.contractor) and p.projectStatus=1 and cs.contractor=? and p.address.zipCode in (?,?,?,?))]
  3. 0

    Hibernate Community • View topic - Using List in HQL WHERE clause

    hibernate.org | 10 months ago
    org.springframework.orm.hibernate3.HibernateQueryException: expecting IDENT, found ':' near line 1, column 175 [select l from Location as l where l.latitude = :lat and l.longitude = :long and l.category.code in elements(:codes)]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found ':' near line 1, column 175 [select l from Location as l where l.latitude = :lat and l.longitude = :long and l.category.code in elements(:codes)]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    How to use inner join query in hql?

    Stack Overflow | 2 years ago | Akshant poonia
    org.hibernate.hql.ast.QuerySyntaxException: unexpected token: on near line 1, column 74 [select user_name, message from com.csc.project.user e inner join tweet p on p.user_id=e.id where e.user_name=:name]
  6. 0

    Problem with Hql Update

    Coderanch | 4 years ago | Sujoy Mukherjee
    org.hibernate.hql.ast.QuerySyntaxException: expecting EQ, found ':' near line 1, column 26 [update book set bookname :bname where bookid :bid]

    6 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.ast.QuerySyntaxException

      unexpected token: by near line 1, column 123 [from by.subpackage.subpackage.bean.Project upperP where upperP in (select p from by.subpackage.subpackage.bean.Project p, by.subpackage.subpackage.bean.ContractorService cs where p.service=cs.serviceId and p not in (select pc.projectId from by.subpackage.subpackage.bean.ProjectContractor pc where pc.contractor=cs.contractor) and p.projectStatus=1 and cs.contractor=? and p.address.zipCode in (?,?,?,?))]

      at org.hibernate.hql.ast.QuerySyntaxException.convert()
    2. Hibernate HQL/JP-QL Parser
      QueryTranslatorImpl.compile
      1. org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
      2. org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
      3. org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:59)
      4. org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:258)
      5. org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
      6. org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
      6 frames
    3. Hibernate
      SessionImpl.createQuery
      1. org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
      2. org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
      3. org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
      4. org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
      5. org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
      6. org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
      6 frames