Search in sources :

Example 1 with JpaCache

use of org.eclipse.persistence.jpa.JpaCache in project cuba by cuba-platform.

the class OrmCacheSupport method evictEntity.

private void evictEntity(Object entity) {
    if (entity != null && !PersistenceHelper.isNew(entity)) {
        EntityManagerFactory emf = persistence.getEntityManager().getDelegate().getEntityManagerFactory();
        JpaCache cache = (JpaCache) emf.getCache();
        cache.evict(entity, true);
    }
}
Also used : JpaCache(org.eclipse.persistence.jpa.JpaCache) EntityManagerFactory(javax.persistence.EntityManagerFactory)

Aggregations

EntityManagerFactory (javax.persistence.EntityManagerFactory)1 JpaCache (org.eclipse.persistence.jpa.JpaCache)1