public DLoadContext(
      SpiEbeanServer ebeanServer,
      BeanDescriptor<?> rootDescriptor,
      Boolean readOnly,
      boolean excludeBeanCache,
      ObjectGraphNode parentNode,
      boolean useAutofetchManager) {

    this.ebeanServer = ebeanServer;
    this.hardRefs = GlobalProperties.getBoolean("ebean.hardrefs", false);
    this.defaultBatchSize = ebeanServer.getLazyLoadBatchSize();
    this.rootDescriptor = rootDescriptor;
    this.rootBeanContext =
        new DLoadBeanContext(
            this, rootDescriptor, null, defaultBatchSize, null, createBeanLoadList());
    this.readOnly = readOnly;
    this.excludeBeanCache = excludeBeanCache;
    this.useAutofetchManager = useAutofetchManager;

    if (parentNode != null) {
      this.origin = parentNode.getOriginQueryPoint();
      this.relativePath = parentNode.getPath();
    } else {
      this.origin = null;
      this.relativePath = null;
    }
  }
  /** Log the FindMany to the transaction log. */
  private void logFindManySummary(CQuery<?> q) {

    SpiQuery<?> query = q.getQueryRequest().getQuery();
    String loadMode = query.getLoadMode();
    String loadDesc = query.getLoadDescription();
    String lazyLoadProp = query.getLazyLoadProperty();
    ObjectGraphNode node = query.getParentNode();

    String originKey;
    if (node == null || node.getOriginQueryPoint() == null) {
      originKey = null;
    } else {
      originKey = node.getOriginQueryPoint().getKey();
    }

    StringBuilder msg = new StringBuilder(200);
    msg.append("FindMany ");
    if (loadMode != null) {
      msg.append("mode[").append(loadMode).append("] ");
    }
    msg.append("type[").append(q.getBeanName()).append("] ");
    if (query.isAutofetchTuned()) {
      msg.append("tuned[true] ");
    }
    if (originKey != null) {
      msg.append("origin[").append(originKey).append("] ");
    }
    if (lazyLoadProp != null) {
      msg.append("lazyLoadProp[").append(lazyLoadProp).append("] ");
    }
    if (loadDesc != null) {
      msg.append("load[").append(loadDesc).append("] ");
    }
    msg.append("exeMicros[").append(q.getQueryExecutionTimeMicros());
    msg.append("] rows[").append(q.getLoadedRowDetail());
    msg.append("] name[").append(q.getName());
    msg.append("] predicates[").append(q.getLogWhereSql());
    msg.append("] bind[").append(q.getBindLog()).append("]");

    q.getTransaction().logSummary(msg.toString());
  }