1Query q = em.createNativeQuery("SELECT a.firstname, a.lastname FROM Author a");
2List<Object[]> authors = q.getResultList();
3
4for (Object[] a : authors) {
5 System.out.println("Author "
6 + a[0]
7 + " "
8 + a[1]);
9}
10