我不知道为什么我得到这个错误。所有错误
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=“选择a.外部标识作为外部标识_从员工a左连接支付公式B上a.外部标识= b.用户标识”,nativeQuery=true)List getEmployeeAndPayment();
公共类PaymentFormulaDto {
private String externalId;
private String employeeName;
private String employeeLastName;
private String pasword;
private String employeeEmail;
private String employeeExternalId;
private String employeeId;
}
1条答案
按热度按时间vaqhlq811#
请使用界面投影或加入SqlResultSetMap。请参阅这篇文章:https://thorben-janssen.com/spring-data-jpa-dto-native-queries/