int updateCount = (int) entityStatistics.getUpdateCount();
int deleteCount = (int) entityStatistics.getDeleteCount();
int fetchCount = (int) entityStatistics.getFetchCount();
int optimisticFailureCount = (int) entityStatistics.getOptimisticFailureCount();
if (loadCount + insertCount + updateCount + deleteCount + fetchCount + optimisticFailureCount != 0) {
HibernateEntityStatistics hibernateEntityStatistics = new HibernateEntityStatistics(entityName, loadCount, updateCount, insertCount,
deleteCount, fetchCount, optimisticFailureCount, hibernateStatistics);
hibernateStatistics.getHibernateEntityStatisticsSet().add(hibernateEntityStatistics);
HibernateTemplate.save(hibernateEntityStatistics);
}
}