I am trying to return custom object from spring data jpa - native query
Here's what I've done so far according to this How to return a custom object from a Spring Data JPA GROUP BY query
I should be able to create query like this:
Query(nativeQuery = true, value = "select sc.case_type as caseType, sc.revision as revision from smart_casemodel sc minus select s.casetype, s.revision from smart_case s")
List<CtRevOnly> findNotUsedCasemodels();
I declared projection Interface
public interface CtRevOnly {
String getCaseType();
String getRevision();
}
Then simply call it
caseModelRepository.findNotUsedCasemodels();
however I get an exception
javax.persistence.PersistenceException: org.hibernate.MappingException: Unknown entity: javax.persistence.Tuple
Any idea what am I doing wrong ?