Sql request with jpa hiberna

This article is tagged with: Sql request with jpa hiberna and mysql

sql request with jpa hiberna

Query q = em.createNativeQuery("SELECT a.firstname, a.lastname FROM Author a");
List<object[]> authors = q.getResultList();
 
for (Object[] a : authors) {
    System.out.println("Author "
            + a[0]
            + " "
            + a[1]);
}
</object[]>

This article is tagged with: Sql request with jpa hiberna and mysql