HHH-18771: If positive, substract listIndexBase from index

This commit is contained in:
Selaron 2024-10-25 22:00:06 +02:00 committed by Marco Belladelli
parent b5302f31e5
commit b8dc72ccb2
1 changed files with 4 additions and 1 deletions

View File

@ -121,10 +121,13 @@ public class ListInitializer extends AbstractImmediateCollectionInitializer<Abst
final Initializer<?> initializer = elementAssembler.getInitializer();
if ( initializer != null ) {
final RowProcessingState rowProcessingState = data.getRowProcessingState();
final Integer index = listIndexAssembler.assemble( rowProcessingState );
Integer index = listIndexAssembler.assemble( rowProcessingState );
if ( index != null ) {
final PersistentList<?> list = getCollectionInstance( data );
assert list != null;
if ( listIndexBase != 0 ) {
index -= listIndexBase;
}
initializer.resolveInstance( list.get( index ), rowProcessingState );
}
}