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

import org.hibernate.stat.CollectionStatistics;

public class ActivatedHibernateCollectionStatistik extends HibernateCollectionStatistik {

  private final CollectionStatistics statistics;

  public ActivatedHibernateCollectionStatistik(String name, CollectionStatistics statistics) {
    super(name);
    this.statistics = statistics;
  }


  public long getUpdateCount() {
    return statistics.getUpdateCount();
  }

  /**
   * "the fetch counter only gets incremented when the entity is retrieved from the datasource (as opposed to any
   * caches)"
   * <p/>
   * http://stackoverflow.com/questions/609351/in-hibernate-statistics-whats-the-difference-between-load-and-fetch
   */
  public long getFetchCount() {
    return statistics.getFetchCount();
  }

  /**
   * "The load counter gets incremented any time the entity gets loaded, whether from the datasource or the caches."
   * <p/>
   * http://stackoverflow.com/questions/609351/in-hibernate-statistics-whats-the-difference-between-load-and-fetch
   */
  public long getLoadCount() {
    return statistics.getLoadCount();
  }

  public long getRemoveCount() {
    return statistics.getRemoveCount();
  }

  public long getRecreateCount() {
    return statistics.getRecreateCount();
  }

}
