如何使用 Play Framework 显示 SQL? [英] How do I show SQL with Play Framework?
问题描述
我有一个使用数据库的 Play 应用程序,出于调试目的,我想展示 JPA 使用的 SQL.我该怎么做?
在 application.conf
中,您可以在取消注释 jpa.debugSQL=true
时打开显示 SQL.这将为您提供带有问号的准备好的语句查询.此外,Play 使用 Hibernate,因此您也可以使用 Hibernate 属性.这些可以直接写在 application.conf
中,也可以写在单独的 hibernate.properties
文件中,该文件位于 Play 应用程序的 conf
文件夹中.>
I have a Play app that uses a database, and for debugging purposes I want to show the SQL that JPA uses. How can I do this?
In application.conf
, you can turn showing SQL on uncommenting jpa.debugSQL=true
. This will give you the prepared statement queries with question marks in them. Also, Play uses Hibernate, so you can also use Hibernate properties. These can be written in application.conf
directly or in a separate hibernate.properties
file residing in the conf
folder of your Play application.
这篇关于如何使用 Play Framework 显示 SQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!