org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias2.name' [select generatedAlias0 from org.hibernate.bugs.entity.Allocation as generatedAlias0 inner join generatedAlias0.resource as generatedAlias1 where generatedAlias2.name=:param0]

Hibernate JIRA | Tony Cramer | 3 months ago
  1. 0

    Accessing property of associated subclass causes an error. Testcase included. Bug does not occur in 5.1.0 and 5.2.0 versions. 5.1.0 ok 5.1.1 fail 5.2.0 ok 5.2.1 fail 5.2.2 fail org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias2.name' [select generatedAlias0 from org.hibernate.bugs.entity.Allocation as generatedAlias0 inner join generatedAlias0.resource as generatedAlias1 where generatedAlias2.name=:param0] at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:74) at org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:91) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:268) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:190) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:142) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:77) at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:152) at org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:526) at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:628)

    Hibernate JIRA | 3 months ago | Tony Cramer
    org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias2.name' [select generatedAlias0 from org.hibernate.bugs.entity.Allocation as generatedAlias0 inner join generatedAlias0.resource as generatedAlias1 where generatedAlias2.name=:param0]
  2. 0

    This might be related to HHH-10561. When performing a join 'x' on a treated join 'y', the join x is not rendered in the resulting HQL, resulting in 'Invalid path' errors. This is best illustrated by an example, the following query: {code} Root<RefEntity> root = criteria.from(RefEntity.class); Join<SubType, RefBySubType> join = cb.treat( root.<RefEntity, BaseType> join("other"), SubType.class) .<SubType, RefBySubType> join("refBySubtype"); criteria.where(cb.equal(join.<Integer> get("myvalue"), 42)); {code} Renders the following HQL: {code} select generatedAlias0 from org.hibernate.bugs.RefEntity as generatedAlias0 inner join generatedAlias0.other as generatedAlias1 where generatedAlias2.myvalue=42 {code} The second join to 'refBySubType' is not added to the query, resulting in the following exception: {code} java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias2.myvalue' [select generatedAlias0 from org.hibernate.bugs.RefEntity as generatedAlias0 inner join generatedAlias0.other as generatedAlias1 where generatedAlias2.myvalue=42] at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1679) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1608) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:551) at org.hibernate.jpa.criteria.CriteriaQueryImpl$1.buildCompiledQuery(CriteriaQueryImpl.java:319) at org.hibernate.jpa.criteria.compile.CriteriaCompiler.compile(CriteriaCompiler.java:130) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:699) at org.hibernate.bugs.JPAUnitTestCase.hhh123Test(JPAUnitTestCase.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias2.myvalue' [select generatedAlias0 from org.hibernate.bugs.RefEntity as generatedAlias0 inner join generatedAlias0.other as generatedAlias1 where generatedAlias2.myvalue=42] at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:74) at org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:91) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:268) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:190) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:142) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:76) at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:150) at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:302) at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:240) at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1907) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:531) ... 29 more {code} I've attached the testcase demonstrating this problem. The testcase is against 5.1, but we see the same problen in 4.3.10 (WildFly 9.0.2).

    Hibernate JIRA | 7 months ago | Emond Papegaaij
    java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias2.myvalue' [select generatedAlias0 from org.hibernate.bugs.RefEntity as generatedAlias0 inner join generatedAlias0.other as generatedAlias1 where generatedAlias2.myvalue=42]
  3. 0

    This might be related to HHH-10561. When performing a join 'x' on a treated join 'y', the join x is not rendered in the resulting HQL, resulting in 'Invalid path' errors. This is best illustrated by an example, the following query: {code} Root<RefEntity> root = criteria.from(RefEntity.class); Join<SubType, RefBySubType> join = cb.treat( root.<RefEntity, BaseType> join("other"), SubType.class) .<SubType, RefBySubType> join("refBySubtype"); criteria.where(cb.equal(join.<Integer> get("myvalue"), 42)); {code} Renders the following HQL: {code} select generatedAlias0 from org.hibernate.bugs.RefEntity as generatedAlias0 inner join generatedAlias0.other as generatedAlias1 where generatedAlias2.myvalue=42 {code} The second join to 'refBySubType' is not added to the query, resulting in the following exception: {code} java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias2.myvalue' [select generatedAlias0 from org.hibernate.bugs.RefEntity as generatedAlias0 inner join generatedAlias0.other as generatedAlias1 where generatedAlias2.myvalue=42] at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1679) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1608) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:551) at org.hibernate.jpa.criteria.CriteriaQueryImpl$1.buildCompiledQuery(CriteriaQueryImpl.java:319) at org.hibernate.jpa.criteria.compile.CriteriaCompiler.compile(CriteriaCompiler.java:130) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:699) at org.hibernate.bugs.JPAUnitTestCase.hhh123Test(JPAUnitTestCase.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias2.myvalue' [select generatedAlias0 from org.hibernate.bugs.RefEntity as generatedAlias0 inner join generatedAlias0.other as generatedAlias1 where generatedAlias2.myvalue=42] at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:74) at org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:91) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:268) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:190) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:142) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:76) at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:150) at org.hibernate.internal.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:302) at org.hibernate.internal.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:240) at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:1907) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:531) ... 29 more {code} I've attached the testcase demonstrating this problem. The testcase is against 5.1, but we see the same problen in 4.3.10 (WildFly 9.0.2).

    Hibernate JIRA | 7 months ago | Emond Papegaaij
    java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias2.myvalue' [select generatedAlias0 from org.hibernate.bugs.RefEntity as generatedAlias0 inner join generatedAlias0.other as generatedAlias1 where generatedAlias2.myvalue=42]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Just upgraded from {{Hibernate 5.1.0 Final}} to {{Hibernate 5.2.2 Final}} and got following produced JPQL from hibernate. {{Invalid path: 'generatedAlias2.imgLocation' }} The following code can reproduce the issue {quote} Join<A, B> somefield= root.join(A.image, JoinType.INNER); Predicate notEmpty = cb.notEqual(cb.treat(somefield,B.class).get(B_.somefield), ""); {quote} We are using {{JPA criteria}} and mainly we do not write {{free text}}. It seems that the cause for the error is using {{treat}} function: removing the use of {{treat}} function makes the issue disappear {quote}SELECT count(generatedAlias0) FROM com.centure.core.matching.entity.ImageForMatch AS generatedAlias0 INNER JOIN generatedAlias0.image AS generatedAlias1 WHERE (generatedAlias2.imgLocation<>:param0) AND (generatedAlias3.photographerName IS NOT NULL) AND (generatedAlias3.category=:param1) AND (generatedAlias0.level=1){quote} It is clear that something went wrong and there generatedAlias2 and generatedAlias3 does not exist.... bq. Sep 08, 2016 12:49:08 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [spring] in context with path [/] threw exception [Request processing failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias2.imgLocation' [select count(generatedAlias0) from com.centure.core.matching.entity.ImageForMatch as generatedAlias0 inner join generatedAlias0.image as generatedAlias1 where ( generatedAlias2.imgLocation<>:param0 ) and ( generatedAlias3.photographerName is not null ) and ( generatedAlias3.category=:param1 ) and ( generatedAlias0.level=1 )]; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias2.imgLocation' [select count(generatedAlias0) from com.centure.core.matching.entity.ImageForMatch as generatedAlias0 inner join generatedAlias0.image as generatedAlias1 where ( generatedAlias2.imgLocation<>:param0 ) and ( generatedAlias3.photographerName is not null ) and ( generatedAlias3.category=:param1 ) and ( generatedAlias0.level=1 )]] with root cause org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias2.imgLocation' [select count(generatedAlias0) from com.centure.core.matching.entity.ImageForMatch as generatedAlias0 inner join generatedAlias0.image as generatedAlias1 where ( generatedAlias2.imgLocation<>:param0 ) and ( generatedAlias3.photographerName is not null ) and ( generatedAlias3.category=:param1 ) and ( generatedAlias0.level=1 )] at org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:74) at org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:91) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:268) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:190) at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:142) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115) at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:77) at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:152) at org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:526) at org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:628) at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:3285) at org.hibernate.query.criteria.internal.CriteriaQueryImpl$1.buildCompiledQuery(CriteriaQueryImpl.java:318) at org.hibernate.query.criteria.internal.compile.CriteriaCompiler.compile(CriteriaCompiler.java:127) at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:3578) at org.hibernate.internal.SessionImpl.createQuery(SessionImpl.java:203) at sun.reflect.GeneratedMethodAccessor763.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:298) at com.sun.proxy.$Proxy129.createQuery(Unknown Source) at org.springframework.data.jpa.repository.support.SimpleJpaRepository.getCountQuery(SimpleJpaRepository.java:685) at org.springframework.data.jpa.repository.support.SimpleJpaRepository.getCountQuery(SimpleJpaRepository.java:659) at org.springframework.data.jpa.repository.support.SimpleJpaRepository.count(SimpleJpaRepository.java:495) at sun.reflect.GeneratedMethodAccessor1041.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:503) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:488) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:460) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:280) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:133) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213) at com.sun.proxy.$Proxy146.count(Unknown Source) at sun.reflect.GeneratedMethodAccessor1616.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java) at java.lang.reflect.Method.invoke(Method.java:498) at org.zeroturnaround.javarebel.integration.util.ReloadingProxyFactory$ReloadingMethodHandler.invoke(SourceFile:74) at com.sun.proxy.$Proxy146.count(Unknown Source) at sun.reflect.GeneratedMethodAccessor1616.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java) at java.lang.reflect.Method.invoke(Method.java:498) at org.zeroturnaround.javarebel.integration.util.ReloadingProxyFactory$ReloadingMethodHandler.invoke(SourceFile:74) at com.sun.proxy.$Proxy146.count(Unknown Source) at com.centure.core.m

    Hibernate JIRA | 3 months ago | oaktree
    org.hibernate.hql.internal.ast.QuerySyntaxException: Invalid path: 'generatedAlias2.imgLocation' [select count(generatedAlias0) from com.centure.core.matching.entity.ImageForMatch as generatedAlias0 inner join generatedAlias0.image as generatedAlias1 where ( generatedAlias2.imgLocation<>:param0 ) and ( generatedAlias3.photographerName is not null ) and ( generatedAlias3.category=:param1 ) and ( generatedAlias0.level=1 )]
  6. 0

    How do I cure "org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree"?

    Stack Overflow | 4 years ago | Dave
    org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree [select generatedAlias0 from org.mainco.subco.organization.domain.Organization as generatedAlias0 where ( generatedAlias0.organizationType in () ) and ( generatedAlias0.state.id=:param0 ) and ( generatedAlias0.country.id=:param1 )]" type="java.lang.IllegalArgumentException"&gt;java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected end of subtree [select generatedAlias0 from org.mainco.subco.organization.domain.Organization as generatedAlias0 where ( generatedAlias0.organizationType in () ) and ( generatedAlias0.state.id=:param0 ) and ( generatedAlias0.country.id=:param1 )]

  1. Shadd518 7 times, last 4 months ago
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.internal.ast.QuerySyntaxException

    Invalid path: 'generatedAlias2.name' [select generatedAlias0 from org.hibernate.bugs.entity.Allocation as generatedAlias0 inner join generatedAlias0.resource as generatedAlias1 where generatedAlias2.name=:param0]

    at org.hibernate.hql.internal.ast.QuerySyntaxException.convert()
  2. Hibernate
    AbstractSharedSessionContract.createQuery
    1. org.hibernate.hql.internal.ast.QuerySyntaxException.convert(QuerySyntaxException.java:74)
    2. org.hibernate.hql.internal.ast.ErrorCounter.throwQueryException(ErrorCounter.java:91)
    3. org.hibernate.hql.internal.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:268)
    4. org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:190)
    5. org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:142)
    6. org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:115)
    7. org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
    8. org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:152)
    9. org.hibernate.internal.AbstractSharedSessionContract.getQueryPlan(AbstractSharedSessionContract.java:526)
    10. org.hibernate.internal.AbstractSharedSessionContract.createQuery(AbstractSharedSessionContract.java:628)
    10 frames