1
<persistence-unit name="acmDB" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>acm20-ds</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.OracleDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WeblogicTransactionManagerLookup"/>
</properties>
</persistence-unit>
有時候我設置hibernate.show_sql
爲true休眠/縫:hibernate.show_sql設置
但後來我不得不再次重新啓動應用程序服務器。我正在使用Weblogic 10和JRebel。
是否有可能設置hibernate.show_sql
爲true,代碼在我需要它的位置?
以供將來參考,請參閱此回答有關如何從一個特定的查詢得到的SQL。這可能是矯枉過正這個特定的問題,但它是我發現捕捉到SQL和領帶回個人HQL,標準或方法調用的最佳方式。 http://stackoverflow.com/questions/554481/how-to-get-sql-from-hibernate-criteria-api-not-for-logging/555192#555192 – 2011-12-08 16:27:31