您的位置:首页 > 编程语言 > Java开发

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

2019-05-16 10:44 2496 查看

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的参数根据实体类中的来就不会报此错。

 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐