Hibernate ORM Statistics - 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 Statistics class.

This code example shows how to use the following methods: toString, getStartTime
		 
		String text = treeCellRendererComponent.getText();
		String tooltip = null;
		if(value instanceof Statistics) {
			Statistics stats = (Statistics) value;
			text = "Statistics " + formatter.format( new Date(stats.getStartTime()) );
			tooltip = stats.toString();
		} 
		 
		if(value instanceof CategorizedStatistics) {
			CategorizedStatistics stats = (CategorizedStatistics) value;
			text = stats.getCategoryName();
			 
		} 
		if(value instanceof EntityStatistics) {
			//EntityStatistics stats = (EntityStatistics) value; 
			 
		} 
		 
		if(value instanceof CollectionStatistics) {
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: clear, getFlushCount, getQueryExecutionCount, getQueryStatistics, getSessionCloseCount
 
	@Test
	public void testSessionStats() throws Exception {
		SessionFactory sf = sessionFactory();
		Statistics stats = sf.getStatistics();
		boolean isStats = stats.isStatisticsEnabled();
		stats.clear();
		stats.setStatisticsEnabled(true);
		Session s = sf.openSession();
		assertEquals( 1, stats.getSessionOpenCount() );
		s.close();
		assertEquals( 1, stats.getSessionCloseCount() );
		s = sf.openSession();
		Transaction tx = s.beginTransaction();
		A a = new A();
		a.setName("mya");
		s.save(a);
		a.setName("b");
		tx.commit();
		s.close();

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getEntityNames, getEntityStatistics
			case 1: return collections;
			case 2:	return queries;		
			case 3: return secondlevelcache;
			} 
		} else if(parent==entities) {
			return stats.getEntityStatistics(stats.getEntityNames()[index]);
		} else if(parent==collections) {
			return stats.getCollectionStatistics(stats.getCollectionRoleNames()[index]);
		} else if(parent==queries) {
			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) { 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
See Code Examples for Hibernate ORM Statistics Methods: