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