Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -931,8 +931,8 @@ public Object proxyFor(EntityPersister persister, EntityKey key, Object impl) th

@Override
public Object proxyFor(Object impl) throws HibernateException {
final EntityEntry e = getEntry( impl );
return e == null ? impl : proxyFor( e.getPersister(), e.getEntityKey(), impl );
final EntityEntry entry = getEntry( impl );
return entry == null ? impl : proxyFor( entry.getPersister(), entry.getEntityKey(), impl );
}

@Override
Expand Down Expand Up @@ -1026,15 +1026,12 @@ public Object getLoadedCollectionOwnerOrNull(PersistentCollection<?> collection)
if ( ce == null || ce.getLoadedPersister() == null ) {
return null;
}

Object loadedOwner = null;
// TODO: an alternative is to check if the owner has changed; if it hasn't then
// return collection.getOwner()
final Object entityId = getLoadedCollectionOwnerIdOrNull( ce );
if ( entityId != null ) {
loadedOwner = getCollectionOwner( entityId, ce.getLoadedPersister() );
else {
// TODO: an alternative is to check if the owner has changed; if it hasn't then
// return collection.getOwner()
final Object entityId = getLoadedCollectionOwnerIdOrNull( ce );
return entityId != null ? getCollectionOwner( entityId, ce.getLoadedPersister() ) : null;
}
return loadedOwner;
}

@Override
Expand All @@ -1052,9 +1049,12 @@ private Object getLoadedCollectionOwnerIdOrNull(CollectionEntry ce) {
if ( ce == null || ce.getLoadedKey() == null || ce.getLoadedPersister() == null ) {
return null;
}
// TODO: an alternative is to check if the owner has changed; if it hasn't then
// get the ID from collection.getOwner()
return ce.getLoadedPersister().getCollectionType().getIdOfOwnerOrNull( ce.getLoadedKey(), session );
else {
// TODO: an alternative is to check if the owner has changed; if it hasn't then
// get the ID from collection.getOwner()
return ce.getLoadedPersister().getCollectionType()
.getIdOfOwnerOrNull( ce.getLoadedKey(), session );
}
}

@Override
Expand Down
Loading
Loading