use of org.hibernate.sql.results.graph.collection.internal.DelayedCollectionFetch in project hibernate-orm by hibernate.
the class PluralAttributeMappingImpl method createDelayedCollectionFetch.
private Fetch createDelayedCollectionFetch(FetchParent fetchParent, NavigablePath fetchablePath, DomainResultCreationState creationState, SqlAstCreationState sqlAstCreationState) {
final DomainResult<?> collectionKeyDomainResult;
// Lazy property. A null foreign key domain result will lead to
// returning a domain result assembler that returns LazyPropertyInitializer.UNFETCHED_PROPERTY
final EntityMappingType containingEntityMapping = findContainingEntityMapping();
if (fetchParent.getReferencedModePart() == containingEntityMapping && containingEntityMapping.getEntityPersister().getPropertyLaziness()[getStateArrayPosition()]) {
collectionKeyDomainResult = null;
} else {
collectionKeyDomainResult = getKeyDescriptor().createTargetDomainResult(fetchablePath, sqlAstCreationState.getFromClauseAccess().getTableGroup(fetchParent.getNavigablePath()), creationState);
}
return new DelayedCollectionFetch(fetchablePath, this, fetchParent, collectionKeyDomainResult);
}
Aggregations