List of usage examples for org.hibernate Cache evictEntityRegion
@Deprecated default void evictEntityRegion(String entityName)
From source file:com.daphne.es.monitor.web.controller.HibernateCacheMonitorController.java
License:Apache License
@RequestMapping(value = "/evictEntity") @ResponseBody/*from w w w . j a v a2 s. co m*/ public String evictEntity(@RequestParam(value = "entityNames", required = false) String[] entityNames, @RequestParam(value = "entityIds", required = false) Serializable[] entityIds) { boolean entityNamesEmpty = ArrayUtils.isEmpty(entityNames); boolean entityIdsEmpty = ArrayUtils.isEmpty(entityIds); Cache cache = HibernateUtils.getCache(em); if (entityNamesEmpty && entityIdsEmpty) { cache.evictEntityRegions(); } else if (entityIdsEmpty) { for (String entityName : entityNames) { cache.evictEntityRegion(entityName); } } else { for (String entityName : entityNames) { for (Serializable entityId : entityIds) { cache.evictEntity(entityName, entityId); } } } return "??"; }