2013-01-16 30 views
1

这是一个准备好的语句吗?Grails中的准备语句

select 
this_.col_id as col1_1_0_, 
this_.col_label as col2_1_0_, 
this_.col_definitionAsJSON as col4_1_0_ 
from 
tbl_Rule this_ 
where 
this_.class='org.rules.Table' 
and this_.col_label=? 

如果删除第一个“地方”的条件,那么它绝对是一个准备好的声明,并会由数据库缓存。但是第一个“在哪里”的条件是什么?它是否阻止数据库对此查询进行缓存?

回答

2

Hibernate总是使用PreparedStatement来调用数据库。