HHH-17600 - Properly setting next index if ListIndexBase annotation is present

This commit is contained in:
Cedomir Igaly 2023-12-06 10:41:23 +01:00 committed by Christian Beikov
parent 16a3bfb20c
commit e1d326ef3e
1 changed files with 2 additions and 1 deletions

View File

@ -233,7 +233,8 @@ public class OneToManyPersister extends AbstractCollectionPersister {
final JdbcValueBindings jdbcValueBindings = mutationExecutor.getJdbcValueBindings();
try {
int nextIndex = resetIndex ? 0 : getSize( key, session );
int nextIndex = ( resetIndex ? 0 : getSize( key, session ) ) +
Math.max( getAttributeMapping().getIndexMetadata().getListIndexBase(), 0 );
while ( entries.hasNext() ) {
final Object entry = entries.next();