コード例 #1
0
  public void batchRelate(
      ModelRoot modelRoot, boolean relateProxies, boolean notifyChanges, boolean searchAllRoots) {
    InstanceList instances = null;
    ModelRoot baseRoot = modelRoot;

    if (CanBeNestedInComponent == null) {
      // R4202
      Component_c relInst55675 =
          (Component_c) baseRoot.getInstanceList(Component_c.class).get(new Object[] {m_parent_id});
      // if there was no local element, check for any global elements
      // failing that proceed to check other model roots
      if (relInst55675 == null) {
        relInst55675 =
            (Component_c)
                Ooaofooa.getDefaultInstance()
                    .getInstanceList(Component_c.class)
                    .get(new Object[] {m_parent_id});
      }
      if (relInst55675 == null && searchAllRoots && !baseRoot.isCompareRoot()) {
        Ooaofooa[] roots = Ooaofooa.getInstances();
        for (int i = 0; i < roots.length; i++) {
          if (roots[i].isCompareRoot()) {
            // never use elements from any compare root
            continue;
          }
          relInst55675 =
              (Component_c)
                  roots[i].getInstanceList(Component_c.class).get(new Object[] {m_parent_id});
          if (relInst55675 != null) break;
        }
      }
      // synchronized
      if (relInst55675 != null) {
        if (relateProxies || !isProxy() || (inSameComponent(this, relInst55675) && !isProxy())) {
          relInst55675.relateAcrossR4202To(this, notifyChanges);
        }
      }
    }
  }