use of org.hibernate.jpa.HibernateEntityManagerFactory in project wildfly by wildfly.
the class HibernateEntityCacheStatistics method getBaseStatistics.
private org.hibernate.stat.Statistics getBaseStatistics(EntityManagerFactory entityManagerFactory) {
if (entityManagerFactory == null) {
return null;
}
HibernateEntityManagerFactory entityManagerFactoryImpl = (HibernateEntityManagerFactory) entityManagerFactory;
SessionFactory sessionFactory = entityManagerFactoryImpl.getSessionFactory();
if (sessionFactory != null) {
return sessionFactory.getStatistics();
}
return null;
}
use of org.hibernate.jpa.HibernateEntityManagerFactory in project wildfly by wildfly.
the class HibernateEntityStatistics method getBaseStatistics.
private org.hibernate.stat.Statistics getBaseStatistics(EntityManagerFactory entityManagerFactory) {
if (entityManagerFactory == null) {
return null;
}
HibernateEntityManagerFactory entityManagerFactoryImpl = (HibernateEntityManagerFactory) entityManagerFactory;
SessionFactory sessionFactory = entityManagerFactoryImpl.getSessionFactory();
if (sessionFactory != null) {
return sessionFactory.getStatistics();
}
return null;
}
use of org.hibernate.jpa.HibernateEntityManagerFactory in project wildfly by wildfly.
the class HibernateQueryCacheStatistics method getStatistics.
private org.hibernate.stat.QueryStatistics getStatistics(EntityManagerFactory entityManagerFactory, String displayQueryName) {
if (entityManagerFactory == null) {
return null;
}
HibernateEntityManagerFactory entityManagerFactoryImpl = (HibernateEntityManagerFactory) entityManagerFactory;
SessionFactory sessionFactory = entityManagerFactoryImpl.getSessionFactory();
// convert displayed (transformed by QueryNames) query name to original query name to look up query statistics
if (sessionFactory != null) {
String[] originalQueryNames = sessionFactory.getStatistics().getQueries();
if (originalQueryNames != null) {
for (String originalQueryName : originalQueryNames) {
if (QueryName.queryName(originalQueryName).getDisplayName().equals(displayQueryName)) {
return sessionFactory.getStatistics().getQueryStatistics(originalQueryName);
}
}
}
}
return null;
}
Aggregations