@Query(nativeQuery = true, value = """
SELECT DISTINCT confirmed_date FROM position.vw_pemp
WHERE project_id=:projectId
""")
Set<LocalDate> selectDistinctConfirmedDates(Long projectId);
The above method will throw Exception org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.sql.Date] to type [@org.springframework.data.jpa.repository.Query java.time.LocalDate], because hibernate will determine column type from database which is date and hibernate will use java.sql.Date type for it. I have debug the library source code for hours and found there a way to using global configuration to map jdbc type to hibernate type (date to LocalDate), but it is not my expected solution. I want a way to specify result type only to the native query.