问题描述:
org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [org.springframework.data.jpa.repository.query.AbstractJpaQuery$TupleConverter$TupleBackedMap] to type [com.pit.system.dto.SysUserRoleDto]
问题分析:
1、jpa框架使用@Query方法查询数据,在装配到SysUserRoleDto中失败,因为SysUserRoleDto没有跟数据库表映射。
解决办法:使用EntityManager的createQuery()或createNativeQuery()方法进行手动映射。具体实现步骤请参考以下博客。
Hibernate 实现SQL和HQL语句查询(createQuery()、createNativeQuery())https://blog.csdn.net/qq_3897463