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) {
                      Object[] arr;
                      if (!o.getClass().isArray()) {
                          arr = new Object[]{o};
                      } else {
                          arr = (Object[]) o;
                      }
                      if (projection.getArgs().size() < arr.length) {
                          Object[] shortened = new Object[projection.getArgs().size()];
                          System.arraycopy(arr, 0, shortened, 0, shortened.length);
                          arr = shortened;
                      }
                      rv.add(projection.newInstance(arr));
                  } 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