Queries with specific cache region names
Finally, from Hibernate 3.5.4 and 3.6 onwards, queries with specific cache region names are stored under matching cache instances. This means that you can now set query cache region specific settings. For example, assuming you had a query like this: Â Query query = sessionFactory.getCurrentSession().createQuery( Â "select account.branch from Account as account where account.holder = ?"); query.setCacheable(true); query.setCacheRegion("AccountRegion"); Â The query would be stored under "AccountRegion" cache instance and users could control settings in similar fashion to what was done with entities and collections.