SpringBoot 2.3.0上的SpringDataCouchbase @Query无法像以前一样工作

问题描述 投票:1回答:1

我几天前迁移到SpringBoot 2.3.0,以便能够将SpringDataCouchbase 4.0.0及其完全响应的方法与ReactiveTemplate一起使用。但是,在SpringBoot 2.2.6之前运行正常的简单@Query会引发错误。这是查询:

@Query("#{#n1ql.selectEntity} WHERE docType = '" + NotificationMq.DOC_TYPE + "'")
Flux<NotificationMq> myCustomMethod();

所有内容(配置和字段注释在文档之后进行了更新),但是@Query注释似乎并未考虑覆盖字符串派生查询。当前错误是:

org.springframework.data.mapping.PropertyReferenceException: No property myCustomMethod found for type NotificationMq!
    at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:94) ~[spring-data-commons-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:382) ~[spring-data-commons-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:358) ~[spring-data-commons-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.data.mapping.PropertyPath.lambda$from$0(PropertyPath.java:311) ~[spring-data-commons-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at java.util.concurrent.ConcurrentMap.computeIfAbsent(ConcurrentMap.java:324) ~[na:1.8.0_144]
    at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:293) ~[spring-data-commons-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:276) ~[spring-data-commons-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.data.repository.query.parser.Part.<init>(Part.java:82) ~[spring-data-commons-2.3.0.RELEASE.jar:2.3.0.RELEASE]
    at org.springframework.data.repository.query.parser.PartTree$OrPart.lambda$new$0(PartTree.java:251) ~[spring-data-commons-2.3.0.RELEASE.jar:2.3.0.RELEASE]

我的存储库被照常定义:

@Repository
public interface NotificationMqRepository extends ReactiveSortingRepository<NotificationMq, String>

关于可能出什么问题的任何想法?或如何确定@Query是否覆盖并生成查询?

感谢您的帮助。

spring spring-boot couchbase spring-data-couchbase
1个回答
0
投票

遵循Couchbase论坛的回答:

Couchbase Answer

@ Query注释在4.0.0版本中不受支持,但希望在4.0.1版本中受支持。

© www.soinside.com 2019 - 2024. All rights reserved.