code: public Node searchNode(Object key, EntityMetadata m, GraphDatabaseService graphDb, boolean skipProxy)
      {
          Node node = null;
          String idColumnName = ((AbstractAttribute) m.getIdAttribute()).getJPAColumnName();
  
          final MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                  m.getPersistenceUnit());
          if (metaModel.isEmbeddable(m.getIdAttribute().getBindableJavaType()))
          {
              key = serializeIdAttributeValue(m, metaModel, key);
          }
  
          if (indexer.isNodeAutoIndexingEnabled(graphDb))
          {
              // Get the Node auto index
              ReadableIndex<Node> autoNodeIndex = graphDb.index().getNodeAutoIndexer().getAutoIndex();
              IndexHits<Node> nodesFound = autoNodeIndex.get(idColumnName, key);
              node = getMatchingNodeFromIndexHits(nodesFound, skipProxy);
          }
          else
          {
              // Searching within manually created indexes
              Index<Node> nodeIndex = graphDb.index().forNodes(m.getIndexName());
              IndexHits<Node> nodesFound = nodeIndex.get(idColumnName, key);
              node = getMatchingNodeFromIndexHits(nodesFound, skipProxy);
          }
  
          return node;
      }
docs: Searches a node from the database for a given key