code: public List executeQuery(String jsonClause, EntityMetadata entityMetadata)
      {
          List entities = new ArrayList();
          try
          {
              DBCursor cursor = parseAndScroll(jsonClause, entityMetadata.getTableName());
  
              while (cursor.hasNext())
              {
                  DBObject fetchedDocument = cursor.next();
  
                  populateEntity(entityMetadata, entities, fetchedDocument);
              }
              return entities;
  
          }
          catch (JSONParseException jex)
          {
              entities = executeNativeQuery(jsonClause, entityMetadata);
              List result = new ArrayList();
              if (entities.size() > 0 && (entities.get(0) instanceof EnhanceEntity))
              {
                  for (Object obj : entities)
                  {
                      result.add(((EnhanceEntity) obj).getEntity());
                  }
                  return result;
              }
              return entities;
          }
      }
docs: Execute query.
  
  @param jsonClause
  the json clause
  @param entityMetadata
  the entity metadata
  @return the list