And to your question regarding logging of SQL,
You can add <property name="toplink.logging.level" value="fine"/> to
your presistence.xml to see the query that Toplink is going to use:
<persistence-unit name="myPU" transaction-type="RESOURCE_LOCAL">
<provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
<class>dj.bpm.Song</class>
<properties>
<property name="toplink.jdbc.url"
value="jdbc:derby:c:\javadb\databases\DJDB"/>
<property name="toplink.jdbc.user" value="APP"/>
<property name="toplink.jdbc.driver"
value="org.apache.derby.jdbc.EmbeddedDriver"/>
<property name="toplink.jdbc.password" value=""/>
<property name="toplink.logging.level" value="fine"/>
</properties>
</persistence-unit>
Michael Bouschen wrote:
> 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
>>
>
>