Skip to content

Commit 4323f9f

Browse files
committed
HHH-14874 Lazy loading of basic attributes in different @lazygroups throws ArrayIndexOutOfBoundsException
1 parent 3b47b85 commit 4323f9f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1651,6 +1651,7 @@ protected Object initializeLazyPropertiesFromDatastore(
16511651
try {
16521652
Object result = null;
16531653
final Object[] values = lazySelect.load( id, session );
1654+
int i = 0;
16541655
for ( LazyAttributeDescriptor fetchGroupAttributeDescriptor : fetchGroupAttributeDescriptors ) {
16551656
final boolean previousInitialized = initializedLazyAttributeNames.contains( fetchGroupAttributeDescriptor.getName() );
16561657

@@ -1666,11 +1667,11 @@ protected Object initializeLazyPropertiesFromDatastore(
16661667
// of course that would mean a new method on SelfDirtinessTracker to allow un-marking
16671668

16681669
// its already been initialized (e.g. by a write) so we don't want to overwrite
1670+
i++;
16691671
continue;
16701672
}
16711673

1672-
1673-
final Object selectedValue = values[fetchGroupAttributeDescriptor.getLazyIndex()];
1674+
final Object selectedValue = values[i++];
16741675

16751676
final boolean set = initializeLazyProperty(
16761677
fieldName,

0 commit comments

Comments
 (0)