Hibernate ORM SecondLevelCacheStatistics - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM SecondLevelCacheStatistics class.

This code example shows how to use the following methods:getEntries
			return stats.getQueryStatistics(stats.getQueries()[index]);
		} else if(parent==secondlevelcache) {
			return stats.getSecondLevelCacheStatistics( stats.getSecondLevelCacheRegionNames()[index]);
		} else if(parent instanceof SecondLevelCacheStatistics) {
			SecondLevelCacheStatistics slcs = (SecondLevelCacheStatistics) parent;			
			return slcs.getEntries();
		} 
		return null; 
	} 
 
	public int getChildCount(Object parent) { 
		if(parent==stats) {
			return 4; 
		} else if(parent==entities) {
			return stats.getEntityNames().length;
		} else if(parent==collections) {
			return stats.getCollectionRoleNames().length;
		} else if(parent==queries) {
			return stats.getQueries().length;
		} else if(parent==secondlevelcache) {
5
CodeRank
This code example shows how to use the following methods:getEntries
        if (stats == null) {
            System.out.println("null");
            return; 
        } 
        System.out.println(stats);
        System.out.println("Cache Keys: " + stats.getEntries().keySet());
        // System.out.println("Cache Values: " + stats.getEntries().values()); 
    } 
 
    private void printStats(SessionStatistics stats) {
        System.out.println("Session Keys: " + stats.getEntityKeys());
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:getEntries
	public void testEmptySecondLevelCacheEntry() throws Exception {
		sessionFactory().getCache().evictEntityRegion( Item.class.getName() );
		Statistics stats = sessionFactory().getStatistics();
		stats.clear();
		SecondLevelCacheStatistics statistics = stats.getSecondLevelCacheStatistics( Item.class.getName() + ".items" );
		Map cacheEntries = statistics.getEntries();
		assertEquals( 0, cacheEntries.size() );
	} 
 
} 
4
CodeRank
This code example shows how to use the following methods:getEntries
	public void testEmptySecondLevelCacheEntry() throws Exception {
      sessionFactory().getCache().evictCollectionRegion( Item.class.getName() + ".items" );
		Statistics stats = sessionFactory().getStatistics();
		stats.clear();
		SecondLevelCacheStatistics statistics = stats.getSecondLevelCacheStatistics( Item.class.getName() + ".items" );
		Map cacheEntries = statistics.getEntries();
		assertEquals( 0, cacheEntries.size() );
	} 
 
} 
4
CodeRank