List of usage examples for javax.persistence Cache evictAll
public void evictAll();
From source file:com.haulmont.cuba.core.sys.QueryImpl.java
@Override public int executeUpdate() { JpaQuery<T> query = getQuery(); // In some cache configurations (in particular, when shared cache is on, but for some entities cache is set to ISOLATED), // EclipseLink does not evict updated entities from cache automatically. Cache cache = query.getEntityManager().getEntityManagerFactory().getCache(); Class referenceClass = query.getDatabaseQuery().getReferenceClass(); if (referenceClass != null) { cache.evict(referenceClass);//from w ww . java 2 s . c om } else { cache.evictAll(); } return query.executeUpdate(); }