code: private void setEntitiesInResult(EntityMetadata m, List results, JsonArray array)
      {
          for (JsonElement element : array)
          {
  
              String id = element.getAsJsonObject().get("value").getAsJsonObject()
                      .get(((AbstractAttribute) m.getIdAttribute()).getJPAColumnName()).getAsString();
              Object entityFromJson = CouchDBObjectMapper.getEntityFromJson(m.getEntityClazz(), m, element
                      .getAsJsonObject().get("value").getAsJsonObject(), m.getRelationNames(), kunderaMetadata);
              if (entityFromJson != null
                      && (m.getTableName().concat(id)).equals(element.getAsJsonObject().get("id").getAsString()))
              {
                  results.add(entityFromJson);
              }
  
          }
      }
docs: Sets the entities in result.
  
  @param m
  the m
  @param results
  the results
  @param array
  the array