@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics( getEntityManagerFactory( args ), getStatisticName( args ) ); return Long.valueOf( statistics != null ? statistics.getFetchCount() : 0 ); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics( getEntityManagerFactory( args ), getStatisticName( args ) ); return Long.valueOf( statistics != null ? statistics.getDeleteCount() : 0 ); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics( getEntityManagerFactory( args ), getStatisticName( args ) ); return Long.valueOf( statistics != null ? statistics.getInsertCount() : 0 ); } };
public EntityStats(String name, EntityStatistics src) { this(name); this.loadCount = src.getLoadCount(); this.updateCount = src.getUpdateCount(); this.insertCount = src.getInsertCount(); this.deleteCount = src.getDeleteCount(); this.fetchCount = src.getFetchCount(); this.optimisticFailureCount = src.getOptimisticFailureCount(); }
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics( getEntityManagerFactory( args ), getStatisticName( args ) ); return Long.valueOf( statistics != null ? statistics.getUpdateCount() : 0 ); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics( getEntityManagerFactory( args ), getStatisticName( args ) ); return Long.valueOf( statistics != null ? statistics.getLoadCount() : 0 ); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics( getEntityManagerFactory( args ), getStatisticName( args ) ); return Long.valueOf( statistics != null ? statistics.getOptimisticFailureCount() : 0 ); } };
public EntityStats(String name, EntityStatistics src) { this(name); this.loadCount = src.getLoadCount(); this.updateCount = src.getUpdateCount(); this.insertCount = src.getInsertCount(); this.deleteCount = src.getDeleteCount(); this.fetchCount = src.getFetchCount(); this.optimisticFailureCount = src.getOptimisticFailureCount(); }
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getUpdateCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getLoadCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics(getEntityManagerFactory(args), getPathAddress(args)); return Long.valueOf(statistics != null ? statistics.getOptimisticFailureCount() : 0); } };
public EntityStats(String name, EntityStatistics src) { this(name); this.loadCount = src.getLoadCount(); this.updateCount = src.getUpdateCount(); this.insertCount = src.getInsertCount(); this.deleteCount = src.getDeleteCount(); this.fetchCount = src.getFetchCount(); this.optimisticFailureCount = src.getOptimisticFailureCount(); }
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getFetchCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getInsertCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getDeleteCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getUpdateCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getLoadCount() : 0); } };
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics(getEntityManagerFactory(args), getStatisticName(args)); return Long.valueOf(statistics != null ? statistics.getOptimisticFailureCount() : 0); } };
protected void logEntities(StringBuilder builder, String lineSep, Statistics stats) { builder.append("Important entities statistics: ").append(lineSep); for (String entity : stats.getEntityNames()) { EntityStatistics entityStats = stats.getEntityStatistics(entity); if (entityStats.getInsertCount() > LIMIT || entityStats.getDeleteCount() > LIMIT || entityStats.getUpdateCount() > LIMIT || entityStats.getLoadCount() > LIMIT || entityStats.getFetchCount() > LIMIT) { builder.append(entity).append(" - ") .append("inserted: ").append(entityStats.getInsertCount()) .append(", updated: ").append(entityStats.getUpdateCount()) .append(", removed: ").append(entityStats.getDeleteCount()) .append(", loaded: ").append(entityStats.getLoadCount()) .append(", fetched: ").append(entityStats.getFetchCount()) .append(lineSep); } } builder.append(lineSep); }
@Override public Object invoke(Object... args) { org.hibernate.stat.EntityStatistics statistics = getStatistics(getEntityManagerFactory(args), getPathAddress(args)); return Long.valueOf(statistics != null ? statistics.getFetchCount() : 0); } };