我确实了解如语句与PreparedStatement之间的区别所述,预备语句比动态sql的优势.
但是我不确定如何告诉JPA(不)使用准备好的语句.
However I'm not sure how to tell JPA to (not) use a prepared statement.
我有许多命名查询. JPA是否为此自动使用准备好的语句?标准API呢?我的猜测是它正在使用动态SQL?
I have a number of named queries. Is JPA automatically using prepared statments for this? What about criteria API. My guess is that it's using dynamic sql?
推荐答案我同意Michele的观点,即通常 准备好的语句由底层的JPA提供程序/实现者使用.为了确保您的语句已经准备好并且使用标准JPA缓存了结果(您希望这样做),请在此处查看我的回复:
I concur with Michele in that generally prepared statements are used by the underlying JPA provider/implementer. To assure that your statements are prepared and results cached (should you desire this) using standard JPA please see my response here:
如何有效使用PreparedStatement?
更多推荐
如何告诉JPA使用准备好的语句(或动态sql)?
发布评论