code: private void cascadeInsertFor(ObjectEnvelope mod, List alreadyPrepared)
      {
          // avoid endless recursion, so use List for registration
          if(alreadyPrepared.contains(mod.getIdentity())) return;
          alreadyPrepared.add(mod.getIdentity());
  
          ClassDescriptor cld = getTransaction().getBroker().getClassDescriptor(mod.getObject().getClass());
  
          List refs = cld.getObjectReferenceDescriptors(true);
          cascadeInsertSingleReferences(mod, refs, alreadyPrepared);
  
          List colls = cld.getCollectionDescriptors(true);
          cascadeInsertCollectionReferences(mod, colls, alreadyPrepared);
      }
docs: Walk through the object graph of the specified insert object. Was used for
  recursive object graph walk.