jpa没有集合缓存的概念,而是hibernate里特有的,应此entityManager.getEntityManagerFactory().getCache().evictAll();
hibernate jpacache的实现代码如下(org.hibernate.ejb.EntityManagerFactoryImpl .JPACache);
public void evictAll() {
sessionFactory.getCache().evictEntityRegions();
// TODO : if we want to allow an optional clearing of all cache data, the additional calls would be:
//sessionFactory.getCache().evictCollectionRegions();
//sessionFactory.getCache().evictQueryRegions();
}