HSQLDB org.springframework.dao.TransientDataAccessResourceException on complex select

I have a query that runs fine in Oracle, but I receive a org.springframework.dao.TransientDataAccessResourceException when attempting to run the same query in HSQLDB (using the Oracle compatibility mode).

Here is the query in question:



(select sum(decode(Orders.status, 'C', Orderlines.qty, 0))

from Orderlines where orderId = Orders.id

) as "productQuantity"

from Orders

join Orderlines on Orders.id = Orderlines.orderId

where Orders.customerId = ?

group by Orders.id, Orders.status

Here is the root of the stack trace

Caused by: org.hsqldb.HsqlException: java.lang.NullPointerException

at org.hsqldb.error.Error.error(Unknown Source)

at org.hsqldb.result.Result.newErrorResult(Unknown Source)

at org.hsqldb.result.Result.newErrorResult(Unknown Source)

at org.hsqldb.StatementDMQL.execute(Unknown Source)

at org.hsqldb.Session.executeCompiledStatement(Unknown Source)

at org.hsqldb.Session.execute(Unknown Source)

... 60 more

Caused by: java.lang.NullPointerException

at org.hsqldb.ExpressionColumn.getValue(Unknown Source)

at org.hsqldb.Expression.getValue(Unknown Source)

at org.hsqldb.ExpressionOp.getValue(Unknown Source)


Read More »

By: StackOverFlow - Tuesday, 6 November

Related Posts