HHH-7513 Corrected trace logging for one-to-one cascading

This commit is contained in:
brmeyer 2012-10-24 13:39:36 -04:00
parent d627089242
commit deaff9705e
1 changed files with 5 additions and 2 deletions

View File

@ -253,9 +253,12 @@ public final class Cascade {
loadedValue = null; loadedValue = null;
} }
if ( loadedValue != null ) { if ( loadedValue != null ) {
final String entityName = entry.getPersister().getEntityName(); final EntityEntry valueEntry = eventSource
.getPersistenceContext().getEntry(
loadedValue );
final String entityName = valueEntry.getPersister().getEntityName();
if ( LOG.isTraceEnabled() ) { if ( LOG.isTraceEnabled() ) {
final Serializable id = entry.getPersister().getIdentifier( loadedValue, eventSource ); final Serializable id = valueEntry.getPersister().getIdentifier( loadedValue, eventSource );
final String description = MessageHelper.infoString( entityName, id ); final String description = MessageHelper.infoString( entityName, id );
LOG.tracev( "Deleting orphaned entity instance: {0}", description ); LOG.tracev( "Deleting orphaned entity instance: {0}", description );
} }