if ((targetFetchGroup != null) && descriptor.hasFetchGroupManager()
&& !refreshing && sourceQuery.shouldMaintainCache() && !sourceQuery.shouldStoreBypassCache()) {
// Set the fetch group to the domain object, after built.
EntityFetchGroup entityFetchGroup = descriptor.getFetchGroupManager().getEntityFetchGroup(targetFetchGroup);
if (entityFetchGroup != null) {
entityFetchGroup = (EntityFetchGroup)entityFetchGroup.clone();
entityFetchGroup.setRootEntity((FetchGroupTracker) cacheKey.getObject());
entityFetchGroup.setOnEntity(aggregate, executionSession);
}
}
return aggregate;