org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: ( near line 1, column 33 [select pp from Product pp where CONTAINS( pp.keywords, :keywords )]

Hibernate JIRA | Scott Van Wart | 8 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

    The following HQL: select pp from Product pp where CONTAINS( pp.keywords, :keywords ) Will throw this exception: org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: ( near line 1, column 33 [select pp from Product pp where CONTAINS( pp.keywords, :keywords )] at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54) at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47) at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:258) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:183) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:134) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1650) I tried changing it to this: select pp from Product pp where CONTAINS( pp.keywords, :keywords ) = TRUE But then SQL Server doesn't like it (it produces SQL like "CONTAINS(pkgproduct0_.keywords, ?)=1": org.hibernate.exception.SQLGrammarException: could not execute query using scroll Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '='.

    Hibernate JIRA | 8 years ago | Scott Van Wart
    org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: ( near line 1, column 33 [select pp from Product pp where CONTAINS( pp.keywords, :keywords )]
  2. 0

    The following HQL: select pp from Product pp where CONTAINS( pp.keywords, :keywords ) Will throw this exception: org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: ( near line 1, column 33 [select pp from Product pp where CONTAINS( pp.keywords, :keywords )] at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54) at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47) at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:258) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:183) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:134) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101) at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1650) I tried changing it to this: select pp from Product pp where CONTAINS( pp.keywords, :keywords ) = TRUE But then SQL Server doesn't like it (it produces SQL like "CONTAINS(pkgproduct0_.keywords, ?)=1": org.hibernate.exception.SQLGrammarException: could not execute query using scroll Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Incorrect syntax near '='.

    Hibernate JIRA | 8 years ago | Scott Van Wart
    org.hibernate.hql.ast.QuerySyntaxException: unexpected AST node: ( near line 1, column 33 [select pp from Product pp where CONTAINS( pp.keywords, :keywords )]
  3. 0

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

    hibernate.org | 1 year 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

    Erro de persistência. Hibernate + duas chaves primárias !!

    com.br | 2 years ago
    org.hibernate.hql.ast.QuerySyntaxException: unexpected token: values near line 1, column 120 [insert into NBS.PRISMA_BOX_RESERVA (prisma, data_comeca, data_termina, motivo, placa, crm_cod_empresa, crm_cod_evento) values ('XXXXX', TO_DATE('24/01/2012 08:00','DD/MM/YYYY HH24:MI'), TO_DATE('24/01/2012 08:00','DD/MM/YYYY HH24:MI'), 'On Line. Sr(a) XXXXXXXX', '123456', null, null)]

    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 AST node: ( near line 1, column 33 [select pp from Product pp where CONTAINS( pp.keywords, :keywords )]

      at org.hibernate.hql.ast.QuerySyntaxException.convert()
    2. Hibernate HQL/JP-QL Parser
      QueryTranslatorImpl.compile
      1. org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:54)
      2. org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:47)
      3. org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:82)
      4. org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:258)
      5. org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:183)
      6. org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:134)
      6 frames
    3. Hibernate
      SessionImpl.createQuery
      1. org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
      2. org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
      3. org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
      4. org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
      5. org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
      6. org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1650)
      6 frames