Search in sources :

Example 1 with EntityPrinter

use of org.hibernate.internal.util.EntityPrinter in project hibernate-orm by hibernate.

the class AbstractFlushingEventListener method logFlushResults.

@SuppressWarnings(value = { "unchecked" })
private void logFlushResults(FlushEvent event) {
    if (!LOG.isDebugEnabled()) {
        return;
    }
    final EventSource session = event.getSession();
    final PersistenceContext persistenceContext = session.getPersistenceContext();
    LOG.debugf("Flushed: %s insertions, %s updates, %s deletions to %s objects", session.getActionQueue().numberOfInsertions(), session.getActionQueue().numberOfUpdates(), session.getActionQueue().numberOfDeletions(), persistenceContext.getNumberOfManagedEntities());
    LOG.debugf("Flushed: %s (re)creations, %s updates, %s removals to %s collections", session.getActionQueue().numberOfCollectionCreations(), session.getActionQueue().numberOfCollectionUpdates(), session.getActionQueue().numberOfCollectionRemovals(), persistenceContext.getCollectionEntries().size());
    new EntityPrinter(session.getFactory()).toString(persistenceContext.getEntitiesByKey().entrySet());
}
Also used : EventSource(org.hibernate.event.spi.EventSource) PersistenceContext(org.hibernate.engine.spi.PersistenceContext) EntityPrinter(org.hibernate.internal.util.EntityPrinter)

Aggregations

PersistenceContext (org.hibernate.engine.spi.PersistenceContext)1 EventSource (org.hibernate.event.spi.EventSource)1 EntityPrinter (org.hibernate.internal.util.EntityPrinter)1