package de.ivu.elect.business.system.control;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.persistence.EntityManager;

public class DefaultCacheReset {
  public static final DefaultCacheReset INSTANCE = new DefaultCacheReset();

  private static final Logger LOG = LoggerFactory.getLogger(DefaultCacheReset.class);

  @Deprecated // nicht direkt benutzen(!)
  public void reset(EntityManager entityManager) {
    LOG.info("Cache reset");
    entityManager.getEntityManagerFactory().getCache().evictAll();
  }
}
