Example usage for org.hibernate Cache evictNaturalIdRegions

List of usage examples for org.hibernate Cache evictNaturalIdRegions

Introduction

In this page you can find the example usage for org.hibernate Cache evictNaturalIdRegions.

Prototype

@Deprecated
default void evictNaturalIdRegions() 

Source Link

Document

Evict data from all naturalId regions.

Usage

From source file:cn.guoyukun.spring.jpa.repository.hibernate.HibernateUtils.java

License:Apache License

/**
 * ?jpa EntityManagerFactory  /*from  w w  w  .  j a  v  a 2 s  .  co  m*/
 * 1?
 * 2??
 * 3?
 * ?
 * jpa Cache api ?evict ?
 *
 * @param emf
 * @see org.hibernate.ejb.EntityManagerFactoryImpl.JPACache#evictAll()
 */
public static void evictLevel2Cache(EntityManagerFactory emf) {
    Cache cache = HibernateUtils.getCache(emf);
    cache.evictEntityRegions();
    cache.evictCollectionRegions();
    cache.evictDefaultQueryRegion();
    cache.evictQueryRegions();
    cache.evictNaturalIdRegions();
}

From source file:com.topsem.common.repository.jpa.hibernate.Hibernates.java

License:Apache License

/**
 * ?jpa EntityManagerFactory  /*from   w ww  .j a v a2s  .  c om*/
 * 1?
 * 2??
 * 3?
 * ?
 * jpa Cache api ?evict ?
 *
 * @param emf
 * @see org.hibernate.jpa.internal.EntityManagerFactoryImpl.JPACache#evictAll()
 */
public static void evictLevel2Cache(EntityManagerFactory emf) {
    Cache cache = Hibernates.getCache(emf);
    cache.evictEntityRegions();
    cache.evictCollectionRegions();
    cache.evictDefaultQueryRegion();
    cache.evictQueryRegions();
    cache.evictNaturalIdRegions();
}