Retrieves multiple documents from Firestore. Holds a pessimistic lock on all returned
documents.

@param documentReferences List of Document References to fetch.
779582
@Nonnull
  public ApiFuture<List<DocumentSnapshot>> getAll(
      @Nonnull DocumentReference... documentReferences) {
    Preconditions.checkState(isEmpty(), READ_BEFORE_WRITE_ERROR_MSG);

    return firestore.getAll(documentReferences, /*fieldMask=*/ null, transactionId);
  }
1332712
@Override
   void addDocuments(Document[] docs) throws IOException
   {
      for (int i = 0; i < docs.length; i++)
      {
         Document old = pending.put(docs[i].get(FieldNames.UUID), docs[i]);
         if (old != null)
         {
            Util.disposeDocument(old);
         }
         if (pending.size() >= bufferSize)
         {
            commitPending();
         }
         numDocs++;
      }
      invalidateSharedReader();
   }
457621
def _get_toc_reference(app, node, toc, docname):
    
    if isinstance(node, nodes.section) and isinstance(node.parent, nodes.document):
        # Top Level Section header
        ref_id = docname
        toc_reference = _find_toc_node(toc, ref_id, nodes.section)
    elif isinstance(node, nodes.section):
        # Nested Section header
        ref_id = node.attributes["ids"][0]
        toc_reference = _find_toc_node(toc, ref_id, nodes.section)
    else:
        # Desc node
        try:
            ref_id = node.children[0].attributes["ids"][0]
            toc_reference = _find_toc_node(toc, ref_id, addnodes.desc)
        except (KeyError, IndexError) as e:
            LOGGER.warning("Invalid desc node: %s" % e)
            toc_reference = None

    return toc_reference
517306
public void addReference(final String propertyName, final Collection<BeanId> refs) {
        Preconditions.checkNotNull(refs);
        Preconditions.checkNotNull(propertyName);
        checkCircularReference(refs.toArray(new BeanId[refs.size()]));
        List<BeanId> list = references.get(propertyName);
        if (list == null) {
            list = new ArrayList<>();
            list.addAll(refs);
            references.put(propertyName, list);
        } else {
            list.addAll(refs);
        }
    }
1259518
def getreference(self, validate=True):
        """"""

        if self.offset is None: return None #nothing to test
        if self.ref:
            ref = self.doc[self.ref]
        else:
            ref = self.finddefaultreference()

        if not ref:
            raise UnresolvableTextContent("Default reference for textcontent not found!")
        elif not ref.hastext(self.cls):
            raise UnresolvableTextContent("Reference (ID " + str(ref.id) + ") has no such text (class=" + self.cls+")")
        elif validate and self.text() != ref.textcontent(self.cls).text()[self.offset:self.offset+len(self.data[0])]:
            raise UnresolvableTextContent("Reference (ID " + str(ref.id) + ", class=" + self.cls+") found but no text match at specified offset ("+str(self.offset)+")! Expected '" + self.text() + "', got '" + ref.textcontent(self.cls).text()[self.offset:self.offset+len(self.data[0])] +"'")
        else:
            #finally, we made it!
            return ref
577637
public DocumentRevs getDocRevisions(String id, String rev) {
        return getDocRevisions(id, rev,
                new CouchClientTypeReference<DocumentRevs>(DocumentRevs.class));
    }
775697
func (f *FileStore) GetAllReferences(ctx context.Context, data io.Reader, toEncrypt bool) (addrs AddressCollection, err error) {
	// create a special kind of putter, which only will store the references
	putter := &hashExplorer{
		hasherStore: NewHasherStore(f.ChunkStore, f.hashFunc, toEncrypt),
	}
	// do the actual splitting anyway, no way around it
	_, wait, err := PyramidSplit(ctx, data, putter, putter)
	if err != nil {
		return nil, err
	}
	// wait for splitting to be complete and all chunks processed
	err = wait(ctx)
	if err != nil {
		return nil, err
	}
	// collect all references
	addrs = NewAddressCollection(0)
	for _, ref := range putter.references {
		addrs = append(addrs, Address(ref))
	}
	sort.Sort(addrs)
	return addrs, nil
}
129558
@Override
    void findReferencedClassNames(final Set<String> referencedClassNames) {
        if (value != null) {
            value.findReferencedClassNames(referencedClassNames);
        }
    }
454809
function getAllReferences() {
  return _.reduce(
    this.getInheritanceChain(),
    (acc, cls) => _.reduce(cls.references, (acc2, v, k) => {acc2[k] = v; return acc2}, acc),
    {})
}
973718
public void retrieveReference(Object pInstance, String pAttributeName) throws PersistenceBrokerException
    {
        if (logger.isDebugEnabled())
        {
        	logger.debug("Retrieving reference named ["+pAttributeName+"] on object of type ["+
        	            pInstance.getClass().getName()+"]");
        }
        ClassDescriptor cld = getClassDescriptor(pInstance.getClass());
        CollectionDescriptor cod = cld.getCollectionDescriptorByName(pAttributeName);
        getInternalCache().enableMaterializationCache();
        // to avoid problems with circular references, locally cache the current object instance
        Identity oid = serviceIdentity().buildIdentity(pInstance);
        boolean needLocalRemove = false;
        if(getInternalCache().doLocalLookup(oid) == null)
        {
            getInternalCache().doInternalCache(oid, pInstance, MaterializationCache.TYPE_TEMP);
            needLocalRemove = true;
        }
        try
        {
            if (cod != null)
            {
                referencesBroker.retrieveCollection(pInstance, cld, cod, true);
            }
            else
            {
                ObjectReferenceDescriptor ord = cld.getObjectReferenceDescriptorByName(pAttributeName);
                if (ord != null)
                {
                    referencesBroker.retrieveReference(pInstance, cld, ord, true);
                }
                else
                {
                    throw new PersistenceBrokerException("did not find attribute " + pAttributeName +
                            " for class " + pInstance.getClass().getName());
                }
            }
            // do locally remove the object to avoid problems with object state detection (insert/update),
            // because objects found in the cache detected as 'old' means 'update'
            if(needLocalRemove) getInternalCache().doLocalRemove(oid);
            getInternalCache().disableMaterializationCache();
        }
        catch(RuntimeException e)
        {
            getInternalCache().doLocalClear();
            throw e;
        }
    }
704265
def get_external_references(self):
        
        for ext_ref_node in self.node.findall('externalReferences'):
            ext_refs_obj = CexternalReferences(ext_ref_node)
            for ref in ext_refs_obj:
                yield ref
506452
def get_external_references(self):
        
        node = self.node.find('externalReferences')
        if node is not None:
            ext_refs = CexternalReferences(node)
            for ext_ref in ext_refs:
                yield ext_ref
727399
@Programmatic
    public DocumentType findByReference(
            final String reference) {
        return queryResultsCache.execute(
                () -> repositoryService.firstMatch(
                    new QueryDefault<>(DocumentType.class,
                            "findByReference",
                            "reference", reference)),
                DocumentTypeRepository.class,
                "findByReference", reference);

    }
854106
private Object convertReference(Object fieldValue) {
    DocumentReference reference;
    if (fieldValue instanceof String) {
      reference = new DocumentReference(firestore, path.append((String) fieldValue));
    } else if (fieldValue instanceof DocumentReference) {
      reference = (DocumentReference) fieldValue;
    } else {
      throw new IllegalArgumentException(
          "The corresponding value for FieldPath.documentId() must be a String or a "
              + "DocumentReference.");
    }

    if (!this.path.isPrefixOf(reference.getResourcePath())) {
      throw new IllegalArgumentException(
          String.format(
              "'%s' is not part of the query result set and cannot be used as a query boundary.",
              reference.getPath()));
    }
    if (!reference.getParent().getResourcePath().equals(this.path)) {
      throw new IllegalArgumentException(
          String.format(
              "Only a direct child can be used as a query boundary. Found: '%s'",
              reference.getPath()));
    }

    return reference;
  }
1102212
function includeReferences(include, doc) {
  _.each(include, function (keypath) {
    var parts = keypath.split('.')
    var key = parts.shift()

    if (_.has(doc, key) && _.isString(doc[key])) {
      var ref = doc[key].split(':')
      doc[key] = getDocument({ collection: ref[0], id: ref[1] })

      if (parts.length > 0) {
        includeReferences(parts.slice(1), doc[key])
      }
    }
  })
}
1132804
public void setDocumentVersions(java.util.Collection<DocumentVersionMetadata> documentVersions) {
        if (documentVersions == null) {
            this.documentVersions = null;
            return;
        }

        this.documentVersions = new java.util.ArrayList<DocumentVersionMetadata>(documentVersions);
    }
1206151
private function loadActualDataForSortedReferenceManyCollectionByIds(
        PersistentCollection $collection,
        array $groupedIds
    ) {
        $mapping = $collection->getMapping();
        $hints = $collection->getHints();

        foreach ($groupedIds as $className => $ids) {
            $class = $this->dm->getClassMetadata($className);
            $mongoCollection = $this->dm->getDocumentCollection($className);
            $criteria = $this->cm->merge(
                array('_id' => array('$in' => array_values($ids))),
                $this->dm->getFilterCollection()->getFilterCriteria($class),
                isset($mapping['criteria']) ? $mapping['criteria'] : array()
            );
            $criteria = $this->uow->getDocumentPersister($className)->prepareQueryOrNewObj(
                $criteria
            );
            $cursor = $mongoCollection->find($criteria);
            if (isset($mapping['sort'])) {
                $cursor->sort($mapping['sort']);
            }
            if (isset($mapping['limit'])) {
                $cursor->limit($mapping['limit']);
            }
            if (isset($mapping['skip'])) {
                $cursor->skip($mapping['skip']);
            }
            if (!empty($hints[Query::HINT_SLAVE_OKAY])) {
                $cursor->slaveOkay(true);
            }
            if (!empty($hints[Query::HINT_READ_PREFERENCE])) {
                $cursor->setReadPreference(
                    $hints[Query::HINT_READ_PREFERENCE],
                    $hints[Query::HINT_READ_PREFERENCE_TAGS]
                );
            }
            $documents = $cursor->toArray(false);
            foreach ($documents as $documentData) {
                $docId = $documentData['_id'];
                $document = $this->uow->getById($docId, $class);
                $data = $this->hydratorFactory->hydrate($document, $documentData);
                $this->uow->setOriginalDocumentData($document, $data);
                $document->__isInitialized__ = true;
                $collection->add($document);
            }
        }
    }