-
Notifications
You must be signed in to change notification settings - Fork 192
scope and collection annotations on repository are not considered during execution. #1441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
|
work-around to to specify scope and collection elsewhere. Scope can be specified in the implementation of AbstractCouchbaseConfiguration (getScope()), as an annotation on the entity class or on the repository as myRepo.withScope(scopeName).deleteInactiveContacts(...) |
mikereiche
added a commit
that referenced
this issue
Jun 17, 2022
… of the repo class. Closes #1441.
mikereiche
added a commit
that referenced
this issue
Jun 17, 2022
… of the repo class. Closes #1441.
mikereiche
added a commit
that referenced
this issue
Jun 17, 2022
… of the repo class. Closes #1441.
mikereiche
added a commit
that referenced
this issue
Jun 17, 2022
… of the repo class. Closes #1441.
mikereiche
added a commit
that referenced
this issue
Jun 17, 2022
The scope and collection repository annotations were not being passed on to derived and @query remove operations. The handling of scope and collection annotations has been reworked in: 1) CrudMethodMetadataProcessor 2) All the *OperationSuppport constructors - the initial scope and collection is taken from the domainEntity class. 3) PseudoArgs 4) AbstractCouchbaseQuery/AbstractReactiveCouchbaseQuery add the scope/collection to the remove operation (analogous to the find Operation). 5) Scope/Collection is passed as args to the execute() method - even though this is redundant at the moment. Closes #1441.
This was referenced Jun 17, 2022
mikereiche
added a commit
that referenced
this issue
Jun 17, 2022
The scope and collection repository annotations were not being passed on to derived and @query remove operations. The handling of scope and collection annotations has been reworked in: 1) CrudMethodMetadataProcessor 2) All the *OperationSuppport constructors - the initial scope and collection is taken from the domainEntity class. 3) PseudoArgs 4) AbstractCouchbaseQuery/AbstractReactiveCouchbaseQuery add the scope/collection to the remove operation (analogous to the find Operation). 5) Scope/Collection is passed as args to the execute() method - even though this is redundant at the moment. Closes #1441.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The issue is that although the collection name (contact) is being used as the keyspace, the query_context of default:. is not being specified as an option.
Customer has a question on using #{#n1ql.delete} -- they're not getting the expected scope/collection in the generated N1QL. What are they doing wrong?
@repository
@scope("contacts")
@Collection("contact")
public interface ContactRepository extends CouchbaseRepository<Contact, String> {
@query("#{#n1ql.delete} WHERE status = $1 AND updateTime < $2 AND #{#n1ql.filter} LIMIT 1")
void deleteInactiveContacts(final ContactStatus status, final long updateTime);
}
com.couchbase.client.core.error.IndexFailureException: The server reported an issue with the underlying index {"completed":true,"coreId":"0x740bdb3700000001","errors":[{"code":12003,"message":"Keyspace not found in CB datastore: default:contact - cause: No bucket named contact"}],"idempotent":false,"lastDispatchedFrom":"y.y.y.y:49272","lastDispatchedTo":"x.x.x.x:8093","requestId":479,"requestType":"QueryRequest","retried":0,"service":{"operationId":"4ed7e8c5-a356-40c7-ab5b-77b0b9fafcca","statement":"DELETE FROM
contact
WHERE status = $1 AND updateTime < $2 AND_class
= "com.xxx.Contact" LIMIT 1","type":"query"},"timeoutMs":75000,"timings":{"dispatchMicros":862708,"totalDispatchMicros":862708,"totalMicros":967676}}The text was updated successfully, but these errors were encountered: