org.hibernate.hql.internal.ast.InvalidWithClauseException

with-clause expressions did not reference from-clause element to which the with-clause was associated [select a from org.hibernate.test.hql.SimpleEntityWithAssociation as e LEFT JOIN e.associatedEntities as a WITH e.name=?]

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web3

  • via Hibernate JIRA by Brett Meyer, 1 year ago
    with-clause expressions did not reference from-clause element to which the with-clause was associated [select a from org.hibernate.test.hql.SimpleEntityWithAssociation as e LEFT JOIN e.associatedEntities as a WITH e.name=?]
  • via Hibernate JIRA by Brett Meyer, 1 year ago
    with-clause expressions did not reference from-clause element to which the with-clause was associated [select a from org.hibernate.test.hql.SimpleEntityWithAssociation as e LEFT JOIN e.associatedEntities as a WITH e.name=?]
  • via Hibernate JIRA by Felix Feisst, 6 months ago
    with clause can only reference columns in the driving table [select e__ from example.domain.Option_AUD e__ inner join example.domain.AbstractAsset_AUD e1 on e__.underlying_id = e1.originalId.id where e__.originalId.rev.id <= :revision and e__
  • Stack trace

    • org.hibernate.hql.internal.ast.InvalidWithClauseException: with-clause expressions did not reference from-clause element to which the with-clause was associated [select a from org.hibernate.test.hql.SimpleEntityWithAssociation as e LEFT JOIN e.associatedEntities as a WITH e.name=?] at org.hibernate.hql.internal.ast.HqlSqlWalker.handleWithFragment(HqlSqlWalker.java:424) at org.hibernate.hql.internal.ast.HqlSqlWalker.createFromJoinElement(HqlSqlWalker.java:399) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.joinElement(HqlSqlBaseWalker.java:3779) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3565) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3443) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:706) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:562) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:299) at org.hibernate.hql.internal.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:247) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:263) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:191) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:143) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:119) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:87) at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:190) at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:300) at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:238) at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1779) at org.hibernate.test.hql.WithClauseTest.testWithJoinRHS(WithClauseTest.java:179) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62)

    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

    You’re the first here who have seen this exception.