persistence@glassfish.java.net

Re: Glassfish V2: From hibernate to toplink: Actual SQL statement

From: Michael Bouschen <mbo.tech_at_spree.de>
Date: Wed, 17 Oct 2007 15:01:13 +0200

Hi,

I assume this a Java Persistence query (not a native query) and you get
a syntax error exception from the query compiler complaining about
RTRIM, correct? The reason is that RTRIM is not a valid string function
in the Java Persistence query language. The supported way is using the
TRIM function with the keyword TRAILING as trim specification. Could you
please try the following query:
   SELECT u FROM Utilisateur u WHERE TRIM (TRAILING FROM u.logname) = :l

Regards Michael

> Hi,
>
> I am porting an EAR application from JBoss 405/Hibernate to Glassfish
> 2/Toplink.
>
> Everything wen well, but some DB request don't work any more.
>
> For instance:
> SELECT OBJECT(u) FROM Utilisateur u WHERE RTRIM(u.logname)=:l
>
> which worked with Hibernate does not work anymore. Is there a way to get
> the actual SQL sent to the DB server
>
> Kind regards,
> TD
>


-- 
Tech_at_Spree Engineering GmbH  Tel.: +49/(0)30/235 520-33
Buelowstr. 66                Fax.: +49/(0)30/217 520-12
10783 Berlin                 mailto:mbo.tech_at_spree.de 
 
Geschaeftsfuehrung: Anna-Kristin Proefrock
Sitz Berlin, Amtsgericht Charlottenburg, HRB 564 52