Named native queries do not work with jakarta.persistence.Tuple return class. E.g. calling entityManager.createNamedQuery("Demo.findAllCustom", Tuple.class); in the test case, it causes following NullPointerException:
Test case: https://github.com/isaul32/spring-data-jpa-named-native-query-bug Working test case (Hibernate 5): https://github.com/isaul32/spring-data-jpa-named-native-query-bug/pull/1 |