HHH-15640 ElementCollection with SubSelect FetchMode throws NPE, ownerEntry is null
This commit is contained in:
parent
7337e0be2e
commit
3a0b5feda0
|
@ -86,13 +86,15 @@ public class CollectionLoaderSubSelectFetch implements CollectionLoader {
|
|||
final PersistentCollection<?> collection = persistenceContext.getCollection( collectionKey );
|
||||
attributeMapping.getCollectionDescriptor().getCollectionType().getKeyOfOwner( collection.getOwner(), session );
|
||||
|
||||
final EntityEntry ownerEntry = persistenceContext.getEntry( collection.getOwner() );
|
||||
final BatchFetchQueue batchFetchQueue = persistenceContext.getBatchFetchQueue();
|
||||
final EntityEntry ownerEntry = persistenceContext.getEntry( collection.getOwner() );
|
||||
List<PersistentCollection<?>> subSelectFetchedCollections = null;
|
||||
if ( ownerEntry != null ) {
|
||||
final EntityKey triggerKeyOwnerKey = ownerEntry.getEntityKey();
|
||||
final SubselectFetch registeredFetch = batchFetchQueue.getSubselect( triggerKeyOwnerKey );
|
||||
List<PersistentCollection<?>> subSelectFetchedCollections = null;
|
||||
if ( registeredFetch != null ) {
|
||||
subSelectFetchedCollections = CollectionHelper.arrayList( registeredFetch.getResultingEntityKeys().size() );
|
||||
subSelectFetchedCollections = CollectionHelper.arrayList(
|
||||
registeredFetch.getResultingEntityKeys().size() );
|
||||
|
||||
// there was one, so we want to make sure to prepare the corresponding collection
|
||||
// reference for reading
|
||||
|
@ -112,6 +114,7 @@ public class CollectionLoaderSubSelectFetch implements CollectionLoader {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final JdbcSelect jdbcSelect = sqlAstTranslatorFactory
|
||||
.buildSelectTranslator( sessionFactory, sqlAst )
|
||||
|
|
Loading…
Reference in New Issue