@Override public Collection<String> getDynamicChildrenNames( EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics stats = getBaseStatistics( entityManagerFactoryLookup.entityManagerFactory( pathAddress.getValue( HibernateStatistics.PROVIDER_LABEL ) ) ); if ( stats == null ) { return Collections.emptyList(); } return Collections.unmodifiableCollection( Arrays.asList( stats.getEntityNames() ) ); }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics stats = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))); if (stats == null) { return Collections.emptyList(); } return Collections.unmodifiableCollection(Arrays.asList(stats.getEntityNames())); }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics stats = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))); if (stats == null) { return Collections.emptyList(); } return Collections.unmodifiableCollection(Arrays.asList(stats.getEntityNames())); }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics stats = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))); if (stats == null) { return Collections.emptyList(); } return Collections.unmodifiableCollection(Arrays.asList(stats.getEntityNames())); }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics stats = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))); if (stats == null) { return Collections.emptyList(); } return Collections.unmodifiableCollection(Arrays.asList(stats.getEntityNames())); }
@Override public Collection<String> getDynamicChildrenNames( EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics statistics = getBaseStatistics( entityManagerFactoryLookup.entityManagerFactory( pathAddress.getValue( HibernateStatistics.PROVIDER_LABEL ) ) ); return statistics != null ? Collections.unmodifiableCollection( Arrays.asList( statistics.getEntityNames() ) ) : Collections.EMPTY_LIST; } }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics statistics = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))); return statistics != null ? Collections.unmodifiableCollection(Arrays.asList( statistics.getEntityNames())) : Collections.EMPTY_LIST; } }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics statistics = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))); return statistics != null ? Collections.unmodifiableCollection(Arrays.asList( statistics.getEntityNames())) : Collections.EMPTY_LIST; } }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics statistics = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))); return statistics != null ? Collections.unmodifiableCollection(Arrays.asList( statistics.getEntityNames())) : Collections.EMPTY_LIST; } }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics statistics = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))); return statistics != null ? Collections.unmodifiableCollection(Arrays.asList( statistics.getEntityNames())) : Collections.EMPTY_LIST; } }
json.put("EntityStatistics", entityStatistics); String[] entityNames = statistics.getEntityNames(); for (String entityName : entityNames) { entityStatistics.put(entityName, statistics.getEntityStatistics(entityName));
/** * {@inheritDoc} * * @see net.sf.ehcache.hibernate.management.api.HibernateStats#getEntityStats() */ public TabularData getEntityStats() { List<CompositeData> result = new ArrayList<CompositeData>(); Statistics statistics = getStatistics(); for (String entity : statistics.getEntityNames()) { EntityStats entityStats = new EntityStats(entity, statistics.getEntityStatistics(entity)); result.add(entityStats.toCompositeData()); } TabularData td = EntityStats.newTabularDataInstance(); td.putAll(result.toArray(new CompositeData[result.size()])); return td; }
protected void clearCache(String entityPrefix, boolean inverse) { String[] entityNames = sessionFactory.getStatistics().getEntityNames(); for (String name : entityNames) { boolean match = name.startsWith(entityPrefix); if (match ^ inverse) { evictCacheEntry(name, false); } } }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics stats = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))); if (stats == null) { return Collections.emptyList(); } return Collections.unmodifiableCollection(Arrays.asList(stats.getEntityNames())); }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics stats = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))); if (stats == null) { return Collections.emptyList(); } return Collections.unmodifiableCollection(Arrays.asList(stats.getEntityNames())); }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics statistics = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))); return statistics != null ? Collections.unmodifiableCollection(Arrays.asList( statistics.getEntityNames())) : Collections.EMPTY_LIST; } }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { return Collections.unmodifiableCollection(Arrays.asList( getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))).getEntityNames())); }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { org.hibernate.stat.Statistics statistics = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))); return statistics != null ? Collections.unmodifiableCollection(Arrays.asList( statistics.getEntityNames())) : Collections.EMPTY_LIST; } }
@Override public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) { return Collections.unmodifiableCollection(Arrays.asList( getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))).getEntityNames())); }
public static String[] getEntityStatistics(final IHibernateConfig hconfig) { if (isNull(hconfig)) throw new NullPointerException("Parameter hconfig is null"); SessionFactory sf = HibernateService.getInstance().getSessionFactory(hconfig); if (isNull(sf)) throw new NullPointerException("Could not obtain SessionFactory for Config: " + hconfig); final Statistics stats = sf.getStatistics(); String[] header = new String[] { JVMInfoUtil.getInstance().printSection("Entities for: " + hconfig.toString()) }; return Arrays.stream(stats.getEntityNames()).reduce(header, (a, s) -> ArrayUtils.addAll(a, getEntityStatistics(sf, s)), ArrayUtils::addAll); }