Hi,
I have create a cacheable query like this :
Code:
session.createQuery(
"select count(*) from mt.domain.geo.Land land
where land.landCode=:landCode")
.setString("landCode", code)
.setCacheable(true)
.iterate().next();
the problem is that the query result does not seem to get cached.
the caching works for other cached queries returning mapped object - so no prob with the configuration, I think:-)
hibernate.cache.use_query_cache is set to 'true'
and I have <cache usage="read-only"/> in the mt.domain.geo.Land mapping.
I know it is not being cached because hibernate.show_sql is set to 'true' and I see a
Code:
select count(*) as x0_0_ from land land0_ where (land0_.co_land=? )
each time the app is calling that query.
any idea ?
thanks,
Fred