HHH-8573: Persister is taken according to the actual type of the replaced object
This commit is contained in:
parent
3a75f9fb4e
commit
af03365c86
|
@ -338,9 +338,8 @@ public abstract class EntityType extends AbstractType implements AssociationType
|
|||
}
|
||||
if ( session.getContextEntityIdentifier( original ) == null &&
|
||||
ForeignKeys.isTransient( associatedEntityName, original, Boolean.FALSE, session ) ) {
|
||||
final Object copy = session.getFactory().getEntityPersister( associatedEntityName )
|
||||
final Object copy = session.getEntityPersister( associatedEntityName, original )
|
||||
.instantiate( null, session );
|
||||
//TODO: should this be Session.instantiate(Persister, ...)?
|
||||
copyCache.put( original, copy );
|
||||
return copy;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue