use of org.hibernate.sql.results.graph.entity.internal.EntityDelayedFetchInitializer in project hibernate-orm by hibernate.
the class CircularFetchImpl method createAssembler.
@Override
public DomainResultAssembler createAssembler(FetchParentAccess parentAccess, AssemblerCreationState creationState) {
final DomainResultAssembler resultAssembler = keyResult.createResultAssembler(parentAccess, creationState);
final EntityInitializer initializer = (EntityInitializer) creationState.resolveInitializer(getNavigablePath(), referencedModelPart, () -> {
if (timing == FetchTiming.IMMEDIATE) {
if (selectByUniqueKey) {
return new EntitySelectFetchByUniqueKeyInitializer(parentAccess, fetchable, getNavigablePath(), entityMappingType.getEntityPersister(), resultAssembler);
}
final EntityPersister entityPersister = entityMappingType.getEntityPersister();
if (entityPersister.isBatchLoadable()) {
return new BatchEntitySelectFetchInitializer(parentAccess, (ToOneAttributeMapping) referencedModelPart, getReferencedPath(), entityPersister, resultAssembler);
} else {
return new EntitySelectFetchInitializer(parentAccess, (ToOneAttributeMapping) referencedModelPart, getReferencedPath(), entityPersister, resultAssembler);
}
} else {
return new EntityDelayedFetchInitializer(parentAccess, getReferencedPath(), fetchable, selectByUniqueKey, resultAssembler);
}
});
return new BiDirectionalFetchAssembler(initializer, fetchable.getJavaType());
}
Aggregations