code: private List<?> getResultList(Query query) {
          // TODO : use lazy fetch here?
          if (projection != null) {
              List<?> results = query.getResultList();
              List<Object> rv = new ArrayList<Object>(results.size());
              for (Object o : results) {
                  if (o != null) {
                      if (!o.getClass().isArray()) {
                          o = new Object[]{o};
                      }
                      rv.add(projection.newInstance((Object[]) o));
                  } else {
                      rv.add(null);
                  }
              }
              return rv;
          } else {
              return query.getResultList();
          }
      }
docs: Transforms results using FactoryExpression if ResultTransformer can't be used
  
  @param query query
  @return results