简体   繁体   中英

org.springframework.data.jpa.repository.query.AbstractJpaQuery$Tuple

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;

}

Use interface projection or add SqlResultSet mapping. See this article:https://thorben-janssen.com/spring-data-jpa-dto-native-queries/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM