List of usage examples for org.hibernate Cache evictCollectionRegion
@Deprecated default void evictCollectionRegion(String role)
From source file:com.daphne.es.monitor.web.controller.HibernateCacheMonitorController.java
License:Apache License
@RequestMapping(value = "/evictCollection") @ResponseBody/*from ww w . ja va 2 s .c o m*/ public String evictCollection( @RequestParam(value = "collectionRoleNames", required = false) String[] collectionRoleNames, @RequestParam(value = "collectionEntityIds", required = false) Serializable[] collectionEntityIds) { boolean collectionRoleNamesEmpty = ArrayUtils.isEmpty(collectionRoleNames); boolean collectionEntityIdsEmpty = ArrayUtils.isEmpty(collectionEntityIds); Cache cache = HibernateUtils.getCache(em); if (collectionRoleNamesEmpty && collectionEntityIdsEmpty) { cache.evictEntityRegions(); } else if (collectionEntityIdsEmpty) { for (String collectionRoleName : collectionRoleNames) { cache.evictCollectionRegion(collectionRoleName); } } else { for (String collectionRoleName : collectionRoleNames) { for (Serializable collectionEntityId : collectionEntityIds) { cache.evictCollection(collectionRoleName, collectionEntityIds); } } } return "??"; }