if (sessionFactory != null) {
return sessionFactory.getStatistics();
}
return null;
}
<BUG>private CollectionStatistics getStatistics(final EntityManagerFactory entityManagerFactory, String collectionName) {
SessionFactory sessionFactory = entityManagerFactory.unwrap(SessionFactory.class);</BUG>
if (sessionFactory != null) {
return sessionFactory.getStatistics().getCollectionStatistics(collectionName);
}

if (sessionFactory != null) {
return sessionFactory.getStatistics();
}
return null;
}
private CollectionStatistics getStatistics(final EntityManagerFactory entityManagerFactory, String collectionName) {
if (entityManagerFactory == null) {
return null;
}
SessionFactory sessionFactory = entityManagerFactory.unwrap(SessionFactory.class);
if (sessionFactory != null) {
return sessionFactory.getStatistics().getCollectionStatistics(collectionName);
}
