@Query on SpringBoot 2.3.0 not working as expected

Hello everyone!

I migrated a couple of days ago to SpringBoot 2.3.0 to be able to use SpringDataCouchbase 4.0.0 and its fully reactive approach with the ReactiveTemplate. However, a simple @Query that was working fine before is throwing errors. This is the query:

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

Everything (Configuration and field annotations were updated following the documentation) but it looks like the @Query annotation is not taking into account to override the string derivation query. The actual error is:

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]

Any ideas about what could be wrong? or how to determine if the @Query is overriding and generating the query?

Thanks in advance for your help.

1 Like

@htenjo -
the @Query annotation implementation didn’t make it into spring-data-couchbase 4.0.0, it will be in 4.0.1

2 Likes

Thx for the info @mreiche. Two questions then:

  1. Is there a place where I can find what other features from SpringBoot 2.2.6 are not supported?
  2. Do you know when the 4.0.1 version will be published?

Thanks again.

Have the same issue.
Also @N1qlJoin wasn’t supported on reactive before, and now it isn’t even on the documentation on the blocking implementation.

Do you know when the 4.0.1 version will be published?
It’s on the schedule for June 10. ( Spring Data Neumann SR1). https://spring-calendar.cfapps.io/