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
  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

    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]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

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

    hibernate.org | 7 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)]
  6. 0

    ERRO HQL

    Google Groups | 7 years ago | Denise Viana
    org.hibernate.hql.ast.QuerySyntaxException: unexpected token: where near line 1, column 126 [ select rh from sicprocomp.negocio.Projeto projeto, sicprocomp.negocio.ProjetoRH rh, sicprocomp.negocio.Programa programa, where programa.idPrograma = projeto.programa.idPrograma and projeto.idProjeto = rh.idProjeto and projeto.inTipo in (1,2) and projeto.inStatusProjeto not in (5,4,13,14,12) and projeto.idProjeto = rh.idProjeto and programa.idPrograma = projeto.programa.idPrograma and programa.boAtivo = true and rh.aluno.idAluno = 1122 and rh.inFuncao = 0 and rh.boBolsista = true and programa.dtInicio > projeto.dtFim ]

    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