if ( mergeMap != null ) {
Iterator mergeMapItr = mergeMap.entrySet().iterator();
while ( mergeMapItr.hasNext() ) {
final Map.Entry mergeMapEntry = ( Map.Entry ) mergeMapItr.next();
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();
}
}
}
}
}