Skip to content

Commit 0481eb8

Browse files
gbadnersebersole
authored andcommitted
HHH-8276 - Integrate LoadPlans into UniqueEntityLoader (PoC)
1 parent ba0d145 commit 0481eb8

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

hibernate-core/src/main/java/org/hibernate/loader/plan2/exec/process/internal/EntityReferenceInitializerImpl.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,14 +283,12 @@ private void handleMissingIdentifier(ResultSetProcessingContext context) {
283283
}
284284

285285
final EntityKey ownerEntityKey = fetchOwnerState.getEntityKey();
286-
if ( ownerEntityKey == null ) {
287-
throw new IllegalStateException( "Could not locate fetch owner EntityKey" );
286+
if ( ownerEntityKey != null ) {
287+
context.getSession().getPersistenceContext().addNullProperty(
288+
ownerEntityKey,
289+
fetchedType.getPropertyName()
290+
);
288291
}
289-
290-
context.getSession().getPersistenceContext().addNullProperty(
291-
ownerEntityKey,
292-
fetchedType.getPropertyName()
293-
);
294292
}
295293
}
296294

hibernate-core/src/main/java/org/hibernate/persister/walking/internal/CompositionSingularSubAttributesHelper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ public AttributeDefinition next() {
131131
final int columnSpan = type.getColumnSpan( ownerEntityPersister.getFactory() );
132132
final String[] subAttributeLhsColumns = ArrayHelper.slice( lhsColumns, columnPosition, columnSpan );
133133

134-
final boolean nullable = compositeType.getPropertyNullability()[subAttributeNumber];
134+
135+
final boolean[] propertyNullability = compositeType.getPropertyNullability();
136+
final boolean nullable = propertyNullability == null || propertyNullability[subAttributeNumber];
135137

136138
currentColumnPosition += columnSpan;
137139

0 commit comments

Comments
 (0)