List of usage examples for org.hibernate.cfg Settings isQueryCacheEnabled
public boolean isQueryCacheEnabled()
From source file:de.iteratec.iteraplan.presentation.dialog.Configuration.ConfigurationController.java
License:Open Source License
/** * Clears the Hibernate second-level cache. * // w w w.jav a 2 s .co m * @return the init page */ @RequestMapping public String clearHibernateCache() { Settings settings = sessionFactory.getSettings(); if (settings.isSecondLevelCacheEnabled()) { Cache cache = sessionFactory.getCache(); cache.evictEntityRegions(); cache.evictCollectionRegions(); } if (settings.isQueryCacheEnabled()) { Cache cache = sessionFactory.getCache(); cache.evictDefaultQueryRegion(); cache.evictQueryRegions(); } return initPage; }