Caused by: org.springframework.data.mapping.PropertyReferenceException: No property type found for t

1 篇文章 0 订阅

Caused by: org.springframework.data.mapping.PropertyReferenceException: No property type found for type SysDictionary! Did you mean 'dType','DType'?
    at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:92)
    at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:356)
    at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:332)
    at org.springframework.data.mapping.PropertyPath.lambda$from$0(PropertyPath.java:285)
 

记录下做项目遇到的错误,用的是SpringBoot+jpa。经过检查,发现dao层接口方法写错了参数,这是jpa的规范,不大熟悉的人估计都要经历一波。

解决:

查看实体类发现参数是dType

而Repository中我写成了 :findDistinctByType(String dType),By后面的type少了个d

改成: SysDictionary findDistinctByDType(String dType);

总结:总得来说就是jpa的规范限制的,需要做的就是方法名By的参数根据实体类中的来就不会报此错。

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值