我正在使用Spring Data MongodB 1.4.2.Release版本。对于Spring Data MongoDB,我在一个位置创建了自定义存储库接口和实现,并创建自定义查询函数getUsersName(Users users)
。Spring Data MongoDB在org.springframework.data.mapping.PropertyPath没有找到属性类型
但是我仍然得到以下异常:
Caused by: org.springframework.data.mapping.PropertyReferenceException:
No property get found for type Users! at org.springframework.data.mapping.PropertyPath. (PropertyPath.java:75) at
org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327) at
org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:359) at
org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:359) at
org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307) at
org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:270) at
org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:241) at
org.springframework.data.repository.query.parser.Part.(Part.java:76) at
org.springframework.data.repository.query.parser.PartTree$OrPart.(PartTree.java:201) at
org.springframework.data.repository.query.parser.PartTree$Predicate.buildTree(PartTree.java:291) at
org.springframework.data.repository.query.parser.PartTree$Predicate.(PartTree.java:271) at
org.springframework.data.repository.query.parser.PartTree.(PartTree.java:80) at
org.springframework.data.mongodb.repository.query.PartTreeMongoQuery.(PartTreeMongoQuery.java:47)
下面是我的春节,数据MongoDB的结构:
如文档中提到的自定义库不起作用 - HTTP:/ /docs.spring.io/spring-data/data-mongo/docs/1.4.2.RELEASE/reference/html/repositories.html#repositories.custom-implementations – Navi
它的工作原理。看起来像实现类名称不正确。 – Navi