Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot use Tuple class with native queries

I'm using Spring Boot 1.5.13.RELEASE and I'm trying to use the javax.persistence.Tuple to receive the results from a native query, like:

Query q = em.createNativeQuery(QUERY_STRING, Tuple.class);
q.setParameter(1, param1);
q.getResultList();

But I receive the following error on getResultList:

org.hibernate.MappingException: Unknown entity: javax.persistence.Tuple

Accordly with some links, this should work.

So, how use the Tuple on native queries? Is it possible?

Thanks!

like image 511
Dherik Avatar asked May 16 '18 17:05

Dherik


1 Answers

According to the link that you provided, It will only work if you're using Hibernate 5.2.11+ ....

like image 75
Carlitos Way Avatar answered Sep 30 '22 06:09

Carlitos Way