openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alan Raison" <Alan.Rai...@luminary.co.uk>
Subject RE: Help understanding JPQL Parsing
Date Wed, 05 Aug 2009 10:32:05 GMT
I see that Derby produces the SQL:

SELECT (CAST(t0.name AS VARCHAR(1000)) || CAST(? AS VARCHAR(1000))) AS cname FROM Game t0
ORDER BY cname DESC [params=(String) 123]

Which is virtually identical, so this seems to be a problem with Ingres.

AlanĀ 

> -----Original Message-----
> From: Alan Raison [mailto:Alan.Raison@luminary.co.uk]
> Sent: 05 August 2009 10:24
> To: dev@openjpa.apache.org
> Subject: Help understanding JPQL Parsing
> 
> Hi All
> 
> I've been running the unit tests against Ingres and now have a 93% pass
> rate :)
> 
> One problem I'm having is with the test
> o.a.o.persistence.jdbc.query.TestOrderByQuery.testOrderByConcatAliasDes
> c
> ending().
> 
> The JPQL in the test:
> 
> "SELECT CONCAT(p.name, '123') as cname FROM Game p ORDER BY cname DESC"
> 
> creates the SQL:
> 
> "SELECT (t0.name + ?) AS cname FROM Game t0 ORDER BY cname DESC"
> 
> Unfortunately, Ingres doesn't like the expression (col + ?), since it
> can't resolve the type.
> 
> Does anyone know why this value isn't being substituted in to the SQL?
> I see in SQLBuffer there's a getSQL() method which takes a parameter to
> substitute in parameter values - how can this be used?
> 
> Thanks
> Alan

Mime
View raw message