Skip to content

Instantly share code, notes, and snippets.

@stliu
Created November 6, 2013 00:07
Show Gist options
  • Save stliu/7328622 to your computer and use it in GitHub Desktop.
Save stliu/7328622 to your computer and use it in GitHub Desktop.
select
human0_.mammal as id1_0_0_,
human2_.mammal as id1_0_1_,
human0_2_.description as descript2_0_0_,
human0_2_.body_weight as body_wei3_0_0_,
human0_2_.mother_id as mother_i4_0_0_,
human0_2_.father_id as father_i5_0_0_,
human0_2_.zoo_id as zoo_id6_0_0_,
human0_2_.serialNumber as serialNu7_0_0_,
human0_1_.pregnant as pregnant2_11_0_,
human0_1_.birthdate as birthdat3_11_0_,
human0_.name_first as name_fir2_4_0_,
human0_.name_initial as name_ini3_4_0_,
human0_.name_last as name_las4_4_0_,
human0_.nickName as nickName5_4_0_,
human0_.height_centimeters / 2.54E0 as height_c6_4_0_,
human0_.intValue as intValue7_4_0_,
human0_.floatValue as floatVal8_4_0_,
human0_.bigDecimalValue as bigDecim9_4_0_,
human0_.bigIntegerValue as bigInte10_4_0_,
human2_2_.description as descript2_0_1_,
human2_2_.body_weight as body_wei3_0_1_,
human2_2_.mother_id as mother_i4_0_1_,
human2_2_.father_id as father_i5_0_1_,
human2_2_.zoo_id as zoo_id6_0_1_,
human2_2_.serialNumber as serialNu7_0_1_,
human2_1_.pregnant as pregnant2_11_1_,
human2_1_.birthdate as birthdat3_11_1_,
human2_.name_first as name_fir2_4_1_,
human2_.name_initial as name_ini3_4_1_,
human2_.name_last as name_las4_4_1_,
human2_.nickName as nickName5_4_1_,
human2_.height_centimeters / 2.54E0 as height_c6_4_1_,
human2_.intValue as intValue7_4_1_,
human2_.floatValue as floatVal8_4_1_,
human2_.bigDecimalValue as bigDecim9_4_1_,
human2_.bigIntegerValue as bigInte10_4_1_
from
Human human0_
inner join
Mammal human0_1_
on human0_.mammal=human0_1_.animal
inner join
Animal human0_2_
on human0_.mammal=human0_2_.id
inner join
Human_friends friends1_
on human0_.mammal=friends1_.human1
and (
human2_.nickName like 'bubba'
)
inner join
Human human2_
on friends1_.human2=human2_.mammal
and (
human2_.nickName like 'bubba'
)
inner join
Mammal human2_1_
on human2_.mammal=human2_1_.animal
inner join
Animal human2_2_
on human2_.mammal=human2_2_.id
23:08:14,980 WARN SqlExceptionHelper:144 - SQL Error: 0, SQLState: 42P01
23:08:14,980 ERROR SqlExceptionHelper:146 - ERROR: missing FROM-clause entry for table "human2_"
Position: 1641
org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:123)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:126)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:112)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:67)
at org.hibernate.loader.Loader.getResultSet(Loader.java:2065)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1862)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1838)
at org.hibernate.loader.Loader.doQuery(Loader.java:908)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:353)
at org.hibernate.loader.Loader.doList(Loader.java:2551)
at org.hibernate.loader.Loader.doList(Loader.java:2537)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2367)
at org.hibernate.loader.Loader.list(Loader.java:2362)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:496)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:385)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:229)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1288)
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103)
at org.hibernate.test.hql.WithClauseTest.testWithClause(WithClauseTest.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
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.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63)
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.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
Caused by: org.postgresql.util.PSQLException: ERROR: missing FROM-clause entry for table "human2_"
Position: 1641
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:560)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:302)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:62)
... 27 more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment