HibernateProjectedResultMapper { protected <T, R> String[] returnFields(Query<T, R> query) { List<String> list = query.getReturnFields(); String[] array = new String[list.size()]; return list.toArray(array); } HibernateProjectedResultMapper(ProjectedResultMapper mapper); R mapResult(Object o, Query<T, R> query, String[] returnFields); R mapResult(Object o, Query<T, R> query); @SuppressWarnings("unchecked") List<R> mapResults(List<?> objects, final Query<T, R> query); @SuppressWarnings("unchecked") Iterable<R> mapResults(ScrollableResults objects, final Query<T, R> query);  }
@Test public void returnFields_single() { assertArrayEquals(field, hMapper.returnFields(projected)); }
@Test public void returnFields_multiple() { assertArrayEquals(fields, hMapper.returnFields(projected2)); }
@Test public void returnFields_none() { assertArrayEquals(new String[0], hMapper.returnFields(unprojected)); }