pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: negora <public@negora.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Off-topic? How to extract database statements from JPA?
Date: Mon, 31 Oct 2022 13:27:51 +0100
Message-ID: <500f47cd-411c-108b-f23e-04ef613a0927@negora.com> (raw)
In-Reply-To: <CAG8xnieB=8GCC5ssitW81bGHJ_4xGz=iC663h-1Qj5ViXqn+Dw@mail.gmail.com>
References: <CAG8xnieB=8GCC5ssitW81bGHJ_4xGz=iC663h-1Qj5ViXqn+Dw@mail.gmail.com>

Hi Gus:

JPA (Jakarta Persistence API; previously known as Java Persistence API) 
is "just" the specification. There are several implementations of this. 
The reference implementation is EclipseLink, but there are others widely 
used such as Hibernate or OpenJPA. You should ask which one is being 
used in your company.

The SQL code is generated on the fly, so there is no place where it's 
stored. However, there are ways to view what SQL is generated in real 
time. For example, with Hibernate, you can change the level of the 
"org.hibernate.SQL" logger to "DEBUG", and view what happens behind the 
scenes.

You could also enable the logging in the PostgreSQL server-side and see 
what's happening.

Best regards.


On 31/10/2022 11:50, Gus Spier 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.
>
> Thanks in advance.
>
> Gus





view thread (3+ messages)

Message-ID: <500f47cd-411c-108b-f23e-04ef613a0927@negora.com>
Permalink:  ../500f47cd-411c-108b-f23e-04ef613a0927@negora.com/
Also on:    postgresql.org/message-id/500f47cd-411c-108b-f23e-04ef613a0927@negora.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: public@negora.com
  Subject: Re: Off-topic? How to extract database statements from JPA?
  In-Reply-To: <500f47cd-411c-108b-f23e-04ef613a0927@negora.com>
  References: <CAG8xnieB=8GCC5ssitW81bGHJ_4xGz=iC663h-1Qj5ViXqn+Dw@mail.gmail.com> <500f47cd-411c-108b-f23e-04ef613a0927@negora.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox