Hi,
I met the following error when executing a sql statement (included
in the error message.) However, I can run the same sql statement
successfully thru. console. The version I used is 1.2.124 for both the
server and client.
The error message is :
Caused by: org.h2.jdbc.JdbcSQLException: Column RELATION not found;
SQL statement:
select this_.oid as oid13_5_, this_.fromSideObject as fromSide3_13_5_,
this_.toSideObject as toSideOb4_13_5_,
this_.EFFECTIVE_PERIOD_START_TIME as EFFECTIVE5_13_5_,
this_.EFFECTIVE_PERIOD_START_UNIT as EFFECTIVE6_13_5_,
this_.EFFECTIVE_PERIOD_START_TIMEZONE as EFFECTIVE7_13_5_,
this_.EFFECTIVE_PERIOD_END_TIME as EFFECTIVE8_13_5_,
this_.EFFECTIVE_PERIOD_END_UNIT as EFFECTIVE9_13_5_,
this_.EFFECTIVE_PERIOD_END_TIMEZONE as EFFECTIVE10_13_5_, this_.SHARE
as SHARE13_5_, this_.class as class13_5_, fromsideob1_.oid as oid1_0_,
fromsideob1_.name as name3_0_, fromsideob1_.type as type4_0_,
fromsideob1_.type as type6_0_, fromsideob1_.relation as relation6_0_,
fromsideob1_.clazz_ as clazz_0_, tosideobje2_.oid as oid1_1_,
tosideobje2_.name as name3_1_, tosideobje2_.type as type4_1_,
tosideobje2_.type as type6_1_, tosideobje2_.relation as relation6_1_,
tosideobje2_.id as id7_1_, tosideobje2_.clazz_ as clazz_1_,
citizenshi6_.oid as oid14_2_, citizenshi6_.fromSideObject as
fromSide2_14_2_, citizenshi6_.toSideObject as toSideOb3_14_2_,
citizenshi6_.EFFECTIVE_PERIOD_START_TIME as EFFECTIVE4_14_2_,
citizenshi6_.EFFECTIVE_PERIOD_START_UNIT as EFFECTIVE5_14_2_,
citizenshi6_.EFFECTIVE_PERIOD_START_TIMEZONE as EFFECTIVE6_14_2_,
citizenshi6_.EFFECTIVE_PERIOD_END_TIME as EFFECTIVE7_14_2_,
citizenshi6_.EFFECTIVE_PERIOD_END_UNIT as EFFECTIVE8_14_2_,
citizenshi6_.EFFECTIVE_PERIOD_END_TIMEZONE as EFFECTIVE9_14_2_,
fromsideob7_.oid as oid1_3_, fromsideob7_.name as name3_3_,
fromsideob7_.type as type4_3_, fromsideob7_.type as type6_3_,
fromsideob7_.relation as relation6_3_, fromsideob7_.clazz_ as
clazz_3_, tosideobje8_.oid as oid1_4_, tosideobje8_.name as name3_4_,
tosideobje8_.type as type4_4_, tosideobje8_.type as type6_4_,
tosideobje8_.relation as relation6_4_, tosideobje8_.id as id7_4_,
tosideobje8_.clazz_ as clazz_4_ from Bureaucratship this_ inner join
( select oid, name, null as relation, type, 3 as clazz_ from
Organization union all select oid, name, null as relation, null as
type, 4 as clazz_ from Person union all select oid, null as name,
relation, type, 5 as clazz_ from Position ) fromsideob1_ on
this_.fromSideObject=fromsideob1_.oid inner join ( select null as id,
oid, name, null as relation, type, 3 as clazz_ from Organization union
all select null as id, oid, name, null as relation, null as type, 4 as
clazz_ from Person union all select null as id, oid, null as name,
relation, type, 5 as clazz_ from Position union all select id, oid,
null as name, null as relation, null as type, 8 as clazz_ from
Employee union all select id, oid, null as name, null as relation,
null as type, 7 as clazz_ from Staff ) tosideobje2_ on
this_.toSideObject=tosideobje2_.oid left outer join Citizenship
citizenshi6_ on tosideobje2_.oid=citizenshi6_.oid left outer join
( select oid, name, null as relation, type, 3 as clazz_ from
Organization union all select oid, name, null as relation, null as
type, 4 as clazz_ from Person union all select oid, null as name,
relation, type, 5 as clazz_ from Position ) fromsideob7_ on
citizenshi6_.fromSideObject=fromsideob7_.oid left outer join ( select
null as id, oid, name, null as relation, type, 3 as clazz_ from
Organization union all select null as id, oid, name, null as relation,
null as type, 4 as clazz_ from Person union all select null as id,
oid, null as name, relation, type, 5 as clazz_ from Position union all
select id, oid, null as name, null as relation, null as type, 8 as
clazz_ from Employee union all select id, oid, null as name, null as
relation, null as type, 7 as clazz_ from Staff ) tosideobje8_ on
citizenshi6_.toSideObject=tosideobje8_.oid where fromsideob1_.name=?
and tosideobje2_.name=? [42122-112]
at org.h2.message.Message.getSQLException(Message.java:107)
at org.h2.message.Message.getSQLException(Message.java:118)
at org.h2.message.Message.getSQLException(Message.java:77)
at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:
130)
at org.h2.command.dml.Select.prepare(Select.java:725)
at org.h2.command.dml.SelectUnion.prepare(SelectUnion.java:215)
at org.h2.command.Parser.prepare(Parser.java:203)
at org.h2.engine.Session.prepare(Session.java:395)
at org.h2.engine.Session.prepare(Session.java:382)
at org.h2.table.TableView.recompileQuery(TableView.java:66)
at org.h2.table.TableView.initColumnsAndTables(TableView.java:79)
at org.h2.table.TableView.<init>(TableView.java:56)
at org.h2.table.TableView.createTempView(TableView.java:351)
at org.h2.command.Parser.readTableFilter(Parser.java:941)
at org.h2.command.Parser.readJoin(Parser.java:1221)
at org.h2.command.Parser.parseJoinTableFilter(Parser.java:1509)
at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1504)
at org.h2.command.Parser.parseSelectSimple(Parser.java:1600)
at org.h2.command.Parser.parseSelectSub(Parser.java:1497)
at org.h2.command.Parser.parseSelectUnion(Parser.java:1342)
at org.h2.command.Parser.parseSelect(Parser.java:1330)
at org.h2.command.Parser.parsePrepared(Parser.java:392)
at org.h2.command.Parser.parse(Parser.java:288)
at org.h2.command.Parser.parse(Parser.java:260)
at org.h2.command.Parser.prepareCommand(Parser.java:232)
at org.h2.engine.Session.prepareLocal(Session.java:410)
at org.h2.server.TcpServerThread.process(TcpServerThread.java:221)
at org.h2.server.TcpServerThread.run(TcpServerThread.java:136)
at java.lang.Thread.run(Thread.java:619)
at org.h2.engine.SessionRemote.done(SessionRemote.java:522)
at org.h2.command.CommandRemote.prepare(CommandRemote.java:70)
at org.h2.command.CommandRemote.<init>(CommandRemote.java:48)
at org.h2.engine.SessionRemote.prepareCommand(SessionRemote.java:418)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:
1053)
at org.h2.jdbc.JdbcPreparedStatement.<init>
(JdbcPreparedStatement.java:73)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:
233)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement
(AbstractBatcher.java:534)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement
(AbstractBatcher.java:452)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement
(AbstractBatcher.java:161)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:
1577)
at org.hibernate.loader.Loader.doQuery(Loader.java:696)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections
(Loader.java:259)
at org.hibernate.loader.Loader.doList(Loader.java:2232)
... 31 more
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/h2-database?hl=en.