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(projection.newInstance(new Object[] {null}));
                }
            }
            return rv;
        } else {
            return query.getResultList();
        }
    }
Transforms results using FactoryExpression if ResultTransformer can't be used

@param query query
@return results
querydsl-jpa/src/main/java/com/querydsl/jpa/impl/AbstractJPAQuery.java