Answers for "Native Query"

0

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]);
}
Posted by: Guest on October-19-2020
0

Native Query

@Query(
  value = "SELECT * FROM USERS u WHERE u.status = 1", 
  nativeQuery = true)
Collection<User> findAllActiveUsersNative();
Posted by: Guest on August-18-2021

Code answers related to "Native Query"

Browse Popular Code Answers by Language