没有发现能够从类型[java.math.biginteger]转换为实体的转换器
我正在尝试从数据库中获取交易列表,这是我面临的错误。
“ trace”:“ org.springframework.core.convert.convert.conversionfailedexception:无法从type [java.lang.object []]转换为type [com.wallet.sendmoney.entities.entities.transactionentity] ,1,null,null,kes,null,123456,lqalvzcfjmu6,null,2547xxxxxxxx3,61234,负载钱包,无效,无效,无效,无效,null,null,null,null,ws322,null} null is org is org.ssprespramewrame.core。 .ConverTernOtFoundException:未发现转换器能够从类型[Java.math.biginteger]转换为type [com.wallet.sendmoney.entities.entities.transactionentity]
。
@Repository
public interface TransactionsRepository extends JpaRepository<LoadWalletEntity, Long> {
@Query(value = "SELECT * FROM transactions_attempts WHERE mobile_number= :mobile_number", nativeQuery = true)
List<TransactionEntity> getAllByPhoneNumber(@RequestParam String mobile_number);
}
器 我的实体课程:
@Entity(name = "transactions_attempts")
@Table
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LoadWalletEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String currency;
@Column(name = "mobile_number")
private String mobileNumber;
private String transactionRef;
private String merchantCode;
private Integer amount;
private String networkCode;
private String reason;
private String statusCode;
private String merchantReference;
private String merchantRequestId;
private String checkoutRequestId;
private Integer resultCode;
private String resultDescription;
private String billRefNumber;
private Date transactionDate;
@Column(name = "customer_mobile")
private String customerMobile;
private String thirdPartyTransId;
}
我在这里可能会想念或做错什么。 提前致谢
I'm trying to get a list of transactions from database and this is the error I'm facing.
"trace": "org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.Object[]] to type [com.wallet.sendmoney.entities.TransactionEntity] for value '{1, 1, null, null, KES, null, 123456, LQALVZCFJMU6, null, 2547XXXXXX3, 61234, Load wallet, null, null, null, null, null, WS322, null}'; nested exception is org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.math.BigInteger] to type [com.wallet.sendmoney.entities.TransactionEntity]
I'm using JPA @Query
annotation and here is my repository
@Repository
public interface TransactionsRepository extends JpaRepository<LoadWalletEntity, Long> {
@Query(value = "SELECT * FROM transactions_attempts WHERE mobile_number= :mobile_number", nativeQuery = true)
List<TransactionEntity> getAllByPhoneNumber(@RequestParam String mobile_number);
}
Here is my entity class:
@Entity(name = "transactions_attempts")
@Table
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LoadWalletEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
private String currency;
@Column(name = "mobile_number")
private String mobileNumber;
private String transactionRef;
private String merchantCode;
private Integer amount;
private String networkCode;
private String reason;
private String statusCode;
private String merchantReference;
private String merchantRequestId;
private String checkoutRequestId;
private Integer resultCode;
private String resultDescription;
private String billRefNumber;
private Date transactionDate;
@Column(name = "customer_mobile")
private String customerMobile;
private String thirdPartyTransId;
}
What could I be missing or doing wrong here.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您正在尝试查询
交易范围
的列表,但是您的存储库是通过
此
loadwalletentity
进行的。应该是
you are trying to query a list of
TransactionEntity
but your Repository is extends with
what's this
LoadWalletEntity
????it should be
尝试此解决方案请
:
Try this solution please:
instead of