> On 31/10/2022 11:50 CET Gus Spier <gus.sp...@gmail.com> wrote:
>
> I apologize if this is off-topic, but I've become exceedingly frustrated and
> need help.
>
> The assignment is to evaluate SQL code for an application that has been built
> with Java Springer Persistence API and, if appropriate, offer suggestions to
> improve database performance.
>
> The problem is that I am not a Java guy. I can usually read code and determine
> what it is trying to do. But here, I am at a loss. Where does the JPA hide the
> SQL code? I do not really expect a definitive, explicit answer, but if anybody
> could point me to documentation or a working aid that lays out where the JPA
> stores the DDL and DML, I would be truly grateful.

My JPA knowledge is a bit rusty and I only worked with Hibernate before.
Which JPA implementation do you use?

In case of Hibernate you can enable logging:

        org.hibernate.SQL => DEBUG
        org.hibernate.type.descriptor.sql => TRACE

If you also use Spring you can try the following config instead:

        spring.jpa.show-sql = true
        spring.jpa.properties.hibernate.format_sql = true

--
Erik


Reply via email to