HHH-10375 - Fix adding an entity at index to list with @OrderColumn in detached Entity
(cherry picked from commit da0b46d61c
)
This commit is contained in:
parent
cb00f86a4d
commit
ec7e2d88ef
|
@ -314,19 +314,9 @@ public class PersistentList extends AbstractPersistentCollection implements List
|
|||
if ( index < 0 ) {
|
||||
throw new ArrayIndexOutOfBoundsException( "negative index" );
|
||||
}
|
||||
if ( !isInitialized() || isConnectedToSession() ) {
|
||||
// NOTE : we don't care about the inverse part here because
|
||||
// even if the collection is inverse, this side is driving the
|
||||
// writing of the indexes. And because this is a positioned-add
|
||||
// we need to load the underlying elements to know how that
|
||||
// affects overall re-ordering
|
||||
write();
|
||||
list.add( index, value );
|
||||
}
|
||||
else {
|
||||
queueOperation( new Add( index, value ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
Loading…
Reference in New Issue