Package de.forsthaus.backend.model

Examples of de.forsthaus.backend.model.HibernateStatistics


   * Page, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.metainfo.ComponentInfo)
   */
  @Override
  public ComponentInfo doBeforeCompose(Page page, Component parent, ComponentInfo compInfo) {
    final Row row = (Row) parent.getParent();
    final HibernateStatistics hibernateStatistics = (HibernateStatistics) row.getValue();

    this.guiHibernateStatisticsService.initDetails(hibernateStatistics);

    parent.setAttribute("hs", hibernateStatistics, false);

View Full Code Here


   * (org.hibernate.stat.Statistics)
   */
  @Override
  public void saveStatistics(Statistics statistics, String callMethod, long javaFinishMs) {

    HibernateStatistics hibernateStatistics = new HibernateStatistics(callMethod, javaFinishMs, statistics.getFlushCount(), statistics
        .getPrepareStatementCount(), statistics.getEntityLoadCount(), statistics.getEntityUpdateCount(), statistics.getEntityInsertCount(), statistics
        .getEntityDeleteCount(), statistics.getEntityFetchCount(), statistics.getCollectionLoadCount(), statistics.getCollectionUpdateCount(),
        statistics.getCollectionRemoveCount(), statistics.getCollectionRecreateCount(), statistics.getCollectionFetchCount(), statistics
            .getQueryExecutionCount(), statistics.getOptimisticFailureCount(), statistics.getQueryExecutionMaxTime(),"'"+ statistics
            .getQueryExecutionMaxTimeQueryString()+"'");

    HibernateTemplate.save(hibernateStatistics);

    for (String entityName : statistics.getEntityNames()) {
      EntityStatistics entityStatistics = statistics.getEntityStatistics(entityName);
      int loadCount = (int) entityStatistics.getLoadCount();
      int insertCount = (int) entityStatistics.getInsertCount();
      int updateCount = (int) entityStatistics.getUpdateCount();
      int deleteCount = (int) entityStatistics.getDeleteCount();
      int fetchCount = (int) entityStatistics.getFetchCount();
      int optimisticFailureCount = (int) entityStatistics.getOptimisticFailureCount();
      if (loadCount + insertCount + updateCount + deleteCount + fetchCount + optimisticFailureCount != 0) {
        HibernateEntityStatistics hibernateEntityStatistics = new HibernateEntityStatistics(entityName, loadCount, updateCount, insertCount,
            deleteCount, fetchCount, optimisticFailureCount, hibernateStatistics);
        hibernateStatistics.getHibernateEntityStatisticsSet().add(hibernateEntityStatistics);
        HibernateTemplate.save(hibernateEntityStatistics);
      }
    }
//    System.out.println(ToStringBuilder.reflectionToString(hibernateStatistics) );
  }
View Full Code Here

TOP

Related Classes of de.forsthaus.backend.model.HibernateStatistics

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.