LoginSignup
10
10

More than 5 years have passed since last update.

JPA2で出力されるSQLでbindされているパラメーター表示を行なう方法

Last updated at Posted at 2014-05-26

JPA2でpersistence.xml

<property name="eclipselink.logging.level" value="FINE" />

を設定しても、実行される(であろう)SQLはログ上に表示されますが、
SQLにbindされる値は、以下のようになって確認できません。

bind => [1 parameter bound]|#]

このバインドされているパラメーターを見えるようにするためには、

<property name="eclipselink.logging.parameters" value="true"/>

を追加する事で実際に流れるSQLパラメーターも確認可能になります。

bind => [hoge, piyo, null]

Stackoverflowに聞いたところIs it possible to make glassfish3/eclipselink to log bind varibles values into log file?というそのまんまの質問が見つかりました。

当然ですが、EcliseLinkのドキュメントにも書いてあります。

公式リファレンス大事。

10
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
10