Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] SQL Statement for JPA query

Yes it is possible to do that.

If you just want to see the SQL that was executed, set logging level to FINEST.

If you want it as a string object then use the following function calls:

        ObjectLevelReadQuery query;
        ...
        query.prepareCall(session, new DatabaseRecord());
        query.getSQLString();

Hope that helps!

On 3/23/2011 2:51 PM, Neubauer, Alexander wrote:
Hi,

is it possible to get the SQL statement for a JPA query as string before
execution?

Thanks for your help.


CENIT AG, Industriestrasse 52-54, 70565 Stuttgart, Tel.: +49 711 7825-30, Fax: +49 711 7825-4000, Internet: www.cenit.de
Geschaeftsstellen: Berlin, Duesseldorf, Frankfurt, Hamburg, Hannover, Muenchen, Neu-Isenburg, Oelsnitz, Ratingen, Saarbruecken
Vorstandsmitglieder: Kurt Bengel, Christian Pusch
Aufsichtsratsmitglieder: Andreas Schmidt (Vorsitzender des Aufsichtsrats), Hubert Leypoldt, Andreas Karrer
Bankverbindungen:
Deutsche Bank (BLZ 600 700 70) Kto. 1661 040 IBAN : DE85 6007 0070 0166 1040 00 SWIFT-CODE : DEUTDESS,
Commerzbank (BLZ 600 400 71) Kto. 532 015 500 IBAN : DE83 6004 0071 0532 0155 00 SWIFT-Code : COBADEFF600,
BW-Bank (BLZ 600 501 01) Kto. 2 403 313 IBAN : DE17 6005 0101 0002 4033 13 SWIFT-Code : SOLADEST
Registergericht: Amtsgericht Stuttgart
Handelsregister: HRB Nr. 19117
Umsatzsteuer: ID-Nr. DE 147 862 777

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

--
Thanks and Regards
Rohit Banga
Member Technical Staff
Oracle Server Technologies

Back to the top