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