code: void markReferenceElements(PersistenceBroker broker)
      {
          // these cases will be handled by ObjectEnvelopeTable#cascadingDependents()
          // if(getModificationState().needsInsert() || getModificationState().needsDelete()) return;
  
          Map oldImage = getBeforeImage();
          Map newImage = getCurrentImage();
  
          Iterator iter = newImage.entrySet().iterator();
          while (iter.hasNext())
          {
              Map.Entry entry = (Map.Entry) iter.next();
              Object key = entry.getKey();
              // we only interested in references
              if(key instanceof ObjectReferenceDescriptor)
              {
                  Image oldRefImage = (Image) oldImage.get(key);
                  Image newRefImage = (Image) entry.getValue();
                  newRefImage.performReferenceDetection(oldRefImage);
              }
          }
      }
docs: Mark new or deleted reference elements
  @param broker