Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opTtW-0005xk-9G for pgsql-general@arkaria.postgresql.org; Mon, 31 Oct 2022 12:27:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1opTtV-0002gp-6l for pgsql-general@arkaria.postgresql.org; Mon, 31 Oct 2022 12:27:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opTtU-0002gg-R7 for pgsql-general@lists.postgresql.org; Mon, 31 Oct 2022 12:27:56 +0000 Received: from smtp-relay-02-3.dondominio.net ([31.214.176.36]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1opTtS-0000aV-Ro for pgsql-general@lists.postgresql.org; Mon, 31 Oct 2022 12:27:56 +0000 Received: from localhost (smtp-relay-local.scip.local [127.0.0.1]) by smtp-relay.dondominio.com (Postfix) with SMTP id 7B38F41064 for ; Mon, 31 Oct 2022 13:27:53 +0100 (CET) Received: from mail-node.dondominio.com by smtp-relay.dondominio.com (Postfix) with ESMTP id 3D70D41041 for ; Mon, 31 Oct 2022 13:27:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=negora.com; s=dddk; t=1667219272; bh=J+/uB3jbJs8naoaNtrZC8np1q8j3LTYGQ7a4WMZ7j08=; h=Message-ID:Date:Subject:To:From:Content-Type; b=zsMu0QWLmQvtqtjZX0x/OnnhbLj9wA13A6Gqieq1cZDipsBnPLYEDrRg1AaHl/MG1 HUwGiJiDx0UrWGZ5/JUWwY8Agw5baWRrNx25bjZizAYVxYIBikYwS8rb/NzY97mrPn qUZETYGp0Z41j6Vkcr4v62rNhIojzx0FNoZyg450= Received: from [192.168.6.196] (223.red-83-58-69.dynamicip.rima-tde.net [83.58.69.223]) (Authenticated sender: public@negora.com) by mail-node.dondominio.com (Postfix) with ESMTPA id 283AF401AF for ; Mon, 31 Oct 2022 13:27:52 +0100 (CET) Message-ID: <500f47cd-411c-108b-f23e-04ef613a0927@negora.com> Date: Mon, 31 Oct 2022 13:27:51 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Subject: Re: Off-topic? How to extract database statements from JPA? Content-Language: en-US To: pgsql-general@lists.postgresql.org References: From: negora In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.2 (mail-node.dondominio.com [0.0.0.0]); Mon, 31 Oct 2022 13:27:52 +0100 (CET) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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