// of the loop-in-loop especially considering this is far more likely the 'edge case'
if ( mergeMap != null ) {
for ( Object o : mergeMap.entrySet() ) {
final Entry mergeMapEntry = (Entry) o;
if ( mergeMapEntry.getKey() instanceof HibernateProxy ) {
final HibernateProxy proxy = (HibernateProxy) mergeMapEntry.getKey();
if ( persister.isSubclassEntityName( proxy.getHibernateLazyInitializer().getEntityName() ) ) {
boolean found = isFoundInParent(
propertyName,
childEntity,
persister,
collectionPersister,
mergeMap.get( proxy )
);
if ( !found ) {
found = isFoundInParent(
propertyName,
mergeMap.get( childEntity ),
persister,
collectionPersister,
mergeMap.get( proxy )
);
}
if ( found ) {
return proxy.getHibernateLazyInitializer().getIdentifier();
}
}
}
}
}