code: private GridFSDBFile findGridFSDBFile(EntityMetadata entityMetadata, Object key)
      {
          String id = ((AbstractAttribute) entityMetadata.getIdAttribute()).getJPAColumnName();
          DBObject query = new BasicDBObject("metadata." + id, key);
          KunderaGridFS gfs = new KunderaGridFS(mongoDb, entityMetadata.getTableName());
          return gfs.findOne(query);
      }
docs: Find GRIDFSDBFile.
  
  @param entityMetadata
  the entity metadata
  @param key
  the key
  @return the grid fsdb file