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;
    }
  }