spring data jpa 遇到的問題


org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.Object[]] to type [com.jzh.graduation.entity.SysPermission] for value '{1, 權限管理, /sys/permission/**}'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.Integer] to type [com.jzh.graduation.entity.SysPermission]

原因:返回結果應該轉換為對象SysPermission,JPA原生sql寫在SysUserDao下(返回結果轉換為SysUser),返回結果無法轉換,應該寫在SysPermissionDao下。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM