org.springframework.data.jpa.repository.query.abstractjpaquery $ tuple
我不知道为什么我会遇到这个错误。所有错误
There was an unexpected error (type=Internal Server Error, status=500).
No converter found capable of converting from type [org.springframework.data.jpa.repository.query.AbstractJpaQuery$TupleConverter$TupleBackedMap] to type [com.example.entities.dtos.PaymentFormulaDto]
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.example.entities.dtos.PaymentFormulaDto]```
my query is below
@query(value =“ select a.external_id as externalId_从员工a左JOIN paymentformula b on a.external_id = b.user_id”,nativequery = true) 列出get employeeandpayment();
公共类Paymayforuladto {
private String externalId;
private String employeeName;
private String employeeLastName;
private String pasword;
private String employeeEmail;
private String employeeExternalId;
private String employeeId;
}
I dont know why I am getting this error. All error
There was an unexpected error (type=Internal Server Error, status=500).
No converter found capable of converting from type [org.springframework.data.jpa.repository.query.AbstractJpaQuery$TupleConverter$TupleBackedMap] to type [com.example.entities.dtos.PaymentFormulaDto]
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.example.entities.dtos.PaymentFormulaDto]```
my query is below
@Query(value="select a.external_id as externalId_ from employee a left join paymentformula b on a.external_id = b.user_id",nativeQuery=true)
List getEmployeeAndPayment();
public class PaymentFormulaDto {
private String externalId;
private String employeeName;
private String employeeLastName;
private String pasword;
private String employeeEmail;
private String employeeExternalId;
private String employeeId;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用接口投影或添加sqlresultset映射。
请参阅本文: https://thorben-janssen.com/spring -data-jpa-dto-native-queries/
Use interface projection or add SqlResultSet mapping.
See this article : https://thorben-janssen.com/spring-data-jpa-dto-native-queries/