Hi!

I'm using Eclispselink with H2 1.4.188. I've tried with the 1.4.186 too, 
the problem is the very same. 

I'm using the following db structure:

show columns from COMPLEXTEST1_BASE_NO_ABS;
FIELD   TYPE   NULL   KEY   DEFAULT  
ID DECIMAL(19) NO UNI NULL
DTYPE VARCHAR(31) YES null NULL
GUID CLOB(2147483647) YES null NULL
UUID VARCHAR(255) NO UNI NULL
(4 rows, 23 ms)



show columns from  COMPLEXTEST1_CLASS_A1;
FIELD   TYPE   NULL   KEY   DEFAULT  
ID DECIMAL(19) NO PRI NULL
(1 row, 2 ms)



show columns from  COMPLEXTEST1_CLASS_B1;
FIELD   TYPE   NULL   KEY   DEFAULT  
ID DECIMAL(19) NO PRI NULL
A_ID DECIMAL(19) YES null NULL
(2 rows, 2 ms)



The A_ID is a foreign key to COMPLEXTEST1_CLASS_A1.ID

With the following data:

select * from COMPLEXTEST1_BASE_NO_ABS;
ID   DTYPE   GUID   UUID  
1 Complextest1ClassA1 6e05c875-734c-4dfd-867f-a903ba7ddd4a 1aedabd9-0cf6-
4d7f-ab36-6ec136b114ac
2 Complextest1ClassB1 cb197305-15d7-41b2-87a9-f4cf9cc7a70a 927d0b8f-e298-
4368-af8a-388b752701a3



select * from COMPLEXTEST1_CLASS_A1;
ID  
1
(1 row, 3 ms)



select * from COMPLEXTEST1_CLASS_B1;
ID   A_ID  
2 1
(1 row, 3 ms)


With H2 syntax:

SELECT t0.ID, t0.DTYPE, t0.GUID, t0.UUID, t1.ID, t1.A_ID 
FROM {oj COMPLEXTEST1_BASE_NO_ABS t2 LEFT OUTER JOIN (COMPLEXTEST1_BASE_NO_ABS 
t0 JOIN COMPLEXTEST1_CLASS_B1 t1 ON (t1.ID = t0.ID)) ON (t1.A_ID = t2.ID)}, 
 COMPLEXTEST1_CLASS_A1 t3 
WHERE ((t2.ID = 1) AND ((t3.ID = t2.ID) AND (t2.DTYPE = 
'Complextest1ClassA1')))


With Oracle syntax:

SELECT t0.ID, t0.DTYPE, t0.GUID, t0.UUID, t1.ID, t1.A_ID 
FROM COMPLEXTEST1_BASE_NO_ABS t2 
 LEFT OUTER JOIN (COMPLEXTEST1_BASE_NO_ABS t0 JOIN COMPLEXTEST1_CLASS_B1 t1 
ON (t1.ID = t0.ID)) ON (t1.A_ID = t2.ID), 
 COMPLEXTEST1_CLASS_A1 t3 
WHERE ((t2.ID = 1) AND ((t3.ID = t2.ID) AND (t2.DTYPE = 
'Complextest1ClassA1')))


I'm getting the following exception:

Caused by: org.h2.jdbc.JdbcSQLException: General error: 
"java.lang.NullPointerException" [50000-182]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:
345)
        at org.h2.message.DbException.get(DbException.java:168)
        at org.h2.message.DbException.convert(DbException.java:295)
        at org.h2.message.DbException.toSQLException(DbException.java:268)
        at org.h2.message.TraceObject.logAndConvert(TraceObject.java:352)
        at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:
281)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.
prepareStatement(DatabaseAccessor.java:1556)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.
prepareStatement(DatabaseAccessor.java:1505)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseCall.
prepareStatement(DatabaseCall.java:778)
        at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.
basicExecuteCall(DatabaseAccessor.java:619)
        ... 89 more
Caused by: java.lang.NullPointerException
        at org.h2.table.TableFilter.prepare(TableFilter.java:263)
        at org.h2.table.TableFilter.prepare(TableFilter.java:280)
        at org.h2.table.TableFilter.prepare(TableFilter.java:280)
        at org.h2.command.dml.Select.preparePlan(Select.java:973)
        at org.h2.command.dml.Select.prepare(Select.java:855)
        at org.h2.command.Parser.prepareCommand(Parser.java:247)
        at org.h2.engine.Session.prepareLocal(Session.java:446)
        at org.h2.engine.Session.prepareCommand(Session.java:388)
        at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:
1190)
        at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.
java:72)
        at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:
277)
        ... 93 more


        
When I'm using PostgreSQL the Oracle statement works correctly.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to