mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 00:24:57 +00:00
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 Object replace(
|
||||
}
|
||||
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…
x
Reference in New Issue
Block a user