mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-03-06 17:59:39 +00:00
HHH-13815 TransientObjectException after merging a bidirectional one-to-many with orphan deletion
This commit is contained in:
parent
4d7bb44d01
commit
fefadfe6ea
@ -1295,8 +1295,8 @@ protected static <E> Collection<E> getOrphans(
|
||||
// iterate over the *old* list
|
||||
for ( E old : oldElements ) {
|
||||
if ( !currentSaving.contains( old ) ) {
|
||||
final Object oldId = ForeignKeys.getEntityIdentifierIfNotUnsaved( entityName, old, session );
|
||||
if ( !currentIds.contains( useIdDirect ? oldId : new TypedValue( idType, oldId ) ) ) {
|
||||
final Object oldId = ForeignKeys.getEntityIdentifier( entityName, old, session );
|
||||
if ( oldId != null && !currentIds.contains( useIdDirect ? oldId : new TypedValue( idType, oldId ) ) ) {
|
||||
res.add( old );
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user