code: @Override
      protected List populateEntities(EntityMetadata m, Client client)
      {
          RethinkDB r = ((RethinkDBClient) client).getR();
          Connection conn = ((RethinkDBClient) client).getConnection();
  
          Filter filter = null;
          Pluck pluck;
          Table table = r.db(m.getSchema()).table(m.getTableName());
  
          Cursor cursor = null;
          List results = new ArrayList();
  
          MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
                  .getMetamodel(m.getPersistenceUnit());
          EntityType entityType = metaModel.entity(m.getEntityClazz());
  
          JPQLExpression jpqlExp = kunderaQuery.getJpqlExpression();
          List<String> selectColumns = KunderaQueryUtils.getSelectColumns(jpqlExp);
  
          if (KunderaQueryUtils.hasWhereClause(jpqlExp))
          {
              // add filters
              WhereClause whereClause = KunderaQueryUtils.getWhereClause(jpqlExp);
              Expression whereExp = whereClause.getConditionalExpression();
              filter = table.filter(parseAndBuildFilters(entityType, whereExp));
          }
  
          if (!selectColumns.isEmpty())
          {
              // select by specific columns, consider last for plucking
              pluck = filter == null ? table.pluck(selectColumns) : filter.pluck(selectColumns);
              cursor = pluck.run(conn);
          }
  
          if (cursor == null)
          {
              cursor = (Cursor) (filter == null ? table.run(conn) : filter.run(conn));
          }
  
          for (Object obj : cursor)
          {
              Object entity = KunderaCoreUtils.createNewInstance(m.getEntityClazz());
              buildEntityFromCursor(entity, (HashMap) obj, entityType);
              results.add(entity);
          }
  
          return results;
      }
docs: /*
  (non-Javadoc)
  
  @see
  com.impetus.kundera.query.QueryImpl#populateEntities(com.impetus.kundera.
  metadata.model.EntityMetadata, com.impetus.kundera.client.Client)