I have a native query inside a JPA repository :
public interface TaskRepository extends PagingAndSortingRepository<Task, Integer> {
@Query( nativeQuery = true, value = "select min(t_id) as id, sum(t_estimation_time) as estimationTime, max(t_due_date) as maxDueDate, min(t_due_date) as minDueDate "
+ "from kat_task inner join kat_task_to_workstream on t_id = ttw_frn_task_id "
+ "inner join kat_workstream on ws_id = ttw_frn_workstream_id and t_is_active is true and t_completed_at is null and t_is_active is true "
+ "where ws_id= :workstreamId" )
DueDatesAndEstimationTimeBean getDueDatesAndEstimationTime( @Param( "workstreamId" ) Integer workstreamId );
}
But, when I run the above query I am getting exception
org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.Object[]] to type [com.kat.beans.DueDatesAndEstimationTimeBean] for value '{15666, 10800000, 2017-04-27 14:21:16.0, 2017-03-13 12:20:33.0}'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.Integer] to type [com.kat.beans.DueDatesAndEstimationTimeBean].
Why it is failing to convert? I am new to spring data JPA. Please help