You would also need some ehcache.xml configuration file (or other caching library of your preference). If none found, Hibernate uses the default, which is included in its jar.
Note that query caching might not be very useful in your case, since it is mostly used in cases where few queries with the same parameters are executed. Your case is the opposite: that query can adopt a wide combinatory of parameters!
The cache will store only so many pairs "combination of parameters-resultset" before running out of space.
I don't think it makes much sense naming extra cache regions after your queries' SQL code. Either don't define any region, or use something more meaningful. Also notice that those eccentric "regions" would not be defined in the default cache configuration file ehcache.xml
_________________ Gonzalo Díaz
|