org.hibernate.hql.internal.ast.QuerySyntaxException

expecting "as", found '(' near line 1, column 58 [from org.hibernate.test.hql.Animal h where treat ( treat ( h as Human ).father as Human ).pets is empty]

Solutions on the web208

  • via Hibernate JIRA by Etienne Miret, 1 year ago
    expecting "as", found '(' near line 1, column 58 [from org.hibernate.test.hql.Animal h where treat ( treat ( h as Human ).father as Human ).pets is empty]
  • via Hibernate JIRA by Etienne Miret, 1 year ago
    expecting "as", found '(' near line 1, column 58 [from org.hibernate.test.hql.Animal h where treat ( treat ( h as Human ).father as Human ).pets is empty]
  • via Hibernate JIRA by Etienne Miret, 1 year ago
    unexpected token: ( near line 1, column 114 [select pet from org.hibernate.test.hql.Animal pet, org.hibernate.test.hql.Animal owner where pet member of treat (owner as Human).pets]
  • Stack trace

    • org.hibernate.hql.internal.ast.QuerySyntaxException: expecting "as", found '(' near line 1, column 58 [from org.hibernate.test.hql.Animal h where treat ( treat ( h as Human ).father as Human ).pets is empty] at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:91) at org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:109) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:304) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:203) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:158) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:126) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:88) at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:167) at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:301) at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:239) at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1800) at org.hibernate.test.hql.TreatTest.whereTreatTest(TreatTest.java:95)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    Once, 2 weeks ago
    16 times, 1 month ago
    33 times, 1 month ago
    2 times, 2 months ago
    Unknown user
    Once, 5 months ago
    39 more bugmates