Hibernate 用Grails编写语句

Hibernate 用Grails编写语句,hibernate,grails,database-performance,Hibernate,Grails,Database Performance,这是事先准备好的声明吗 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=? 如果删除第一个“where”条件,那么它肯定是一条准备好的语句,将被数据库缓存。但第一个“何处”条件是什

这是事先准备好的声明吗

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=?

如果删除第一个“where”条件,那么它肯定是一条准备好的语句,将被数据库缓存。但第一个“何处”条件是什么?它是否阻止数据库缓存此查询?

Hibernate始终使用PreparedStatement调用数据库