You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
shagunv
Hi,
I am using spring spring-boot-starter-data-couchbase-reactive version 2.3.1.RELEASE. there is an issue while using @Query inside a repository interface. i am getting Ambiguous reference to field _class error.
Below is the method which i have written @Query("#
AND creation >= $1 ORDER BY creation DESC LIMIT $2 OFFSET $3")
Flux findAllByCreationGreaterThan(long creation, int limit, int offset);
Inside the detailed exception trace i found that it is generating the below query statement :
“statement”:“SELECT META(testbucket).id AS __id, META(testbucket).cas AS __cas, testbucket.* FROM testbucket where _class = \“com.testapp.web.model.UserOrder\” AND creation >= $1 ORDER BY creation DESC LIMIT $2 OFFSET $3 AND _class = \“com.testapp.web.model.UserOrder\””
_class is getting appended at the end of the statement as well.
If i don’t use @Query with order by and limit/offset it is working fine.
How can i solve this?
Is anything wrong in the query which i am writing.
I checked the forum but didn’t find anything related to this issue.
Please help me.
Michael Reiche opened DATACOUCH-580 and commented
https://forums.couchbase.com/t/ambiguous-reference-to-field-class/26653
shagunv
Hi,
I am using spring spring-boot-starter-data-couchbase-reactive version 2.3.1.RELEASE. there is an issue while using
@Query
inside a repository interface. i am getting Ambiguous reference to field _class error.Below is the method which i have written
@Query
("#{#n1ql.selectEntity}
where #
{#n1ql.filter}
AND creation >= $1 ORDER BY creation DESC LIMIT $2 OFFSET $3")
Flux findAllByCreationGreaterThan(long creation, int limit, int offset);
Inside the detailed exception trace i found that it is generating the below query statement :
“statement”:“SELECT META(
testbucket
).id AS __id, META(testbucket
).cas AS __cas,testbucket
.* FROMtestbucket
where_class
= \“com.testapp.web.model.UserOrder\” AND creation >= $1 ORDER BY creation DESC LIMIT $2 OFFSET $3 AND_class
= \“com.testapp.web.model.UserOrder\””_class is getting appended at the end of the statement as well.
If i don’t use
@Query
with order by and limit/offset it is working fine.How can i solve this?
Is anything wrong in the query which i am writing.
I checked the forum but didn’t find anything related to this issue.
Please help me.
Thanks
https://forums.couchbase.com/t/ambiguous-reference-to-field-class/26653
Referenced from: pull request #246
Backported to: 4.0.2 (Neumann SR2)
The text was updated successfully, but these errors were encountered: