dgryoo / pfairplayService

My soccer matching platform
1 stars 0 forks source link

How to run query of String #49

Closed dgryoo closed 3 years ago

dgryoo commented 3 years ago

reference : https://stackoverflow.com/questions/43524569/how-to-execute-a-query-stored-as-string-with-spring-data-jpa

dgryoo commented 3 years ago

Use EntityManager like this

String query = "select bla from bla"
List<T> result = entityManager.createNativeQuery(query ).getResultList();