diff --git a/hibernate-core/src/main/java/org/hibernate/sql/results/graph/entity/internal/EntityInitializerImpl.java b/hibernate-core/src/main/java/org/hibernate/sql/results/graph/entity/internal/EntityInitializerImpl.java index d9610b4f03b4..a62e65fd1097 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/results/graph/entity/internal/EntityInitializerImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/results/graph/entity/internal/EntityInitializerImpl.java @@ -625,6 +625,10 @@ protected void resolveInstanceSubInitializers(EntityInitializerData data) { final EntityEntry entityEntry = data.entityHolder.getEntityEntry(); final Initializer[] initializers; final ImmutableBitSet maybeLazySet; + if ( entityEntry == null ) { + assert data.entityHolder.getEntityInitializer() != null && data.entityHolder.getProxy() != null; + return; + } if ( data.entityHolder.getEntityInitializer() == this ) { // When a previous row initialized this entity already, we only need to process collections initializers = collectionContainingSubInitializers[subclassId];