如果我设置
<property name="show_sql">true</property>
在我的 hibernate.cfg.xml 配置文件中,我可以在控制台上看到SQL语句。但这并不是真正的 SQL... 我能否看到将直接传递给数据库的SQL代码?
例如:
我看到:
select this_.code from true.employee this_ where this_.code=?
我能看到吗?
select employee.code from employee where employee.code=12
真正的 SQL?
true.employee
吗? - Stephen Denne?
替换为:1
、:2
等),在某些特定情况下,它可能会将绑定占位符替换为转义值(一些 MySQL 驱动程序会这样做)。然而,大多数数据库都能够原生地处理带有占位符的查询。 - James_pic