Skip to content

Specific message for string queries that do not project __id and __cas. #1114

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

Conversation

mikereiche
Copy link
Collaborator

Closes #1097.
Original pull request: #1114.

  • You have read the Spring Data contribution guidelines.
  • There is a ticket in the bug tracker for the project in our JIRA.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

quaff and others added 6 commits March 22, 2021 11:25
It was present on non-Reactive, but missing from reactive.

Closes #1096.
Original pull request #1108.

Co-authored-by: mikereiche <[email protected]>
Add QueryCriteria arrayContaining which maps to n1ql array_containing.

Closes #1073.
Original pull request #1109.

Co-authored-by: mikereiche <[email protected]>
Support enum in AbstractCouchbaseConverter.convertForWriteIfNeeded()
and also call that from
MappingCouchbaseConverter.getPotentiallyConvertedSimpleWrite()

Closes #1069.
Original pull request #1112.

Co-authored-by: mikereiche <[email protected]>
* Add QueryCriteria arrayContaining.

Add QueryCriteria arrayContaining which maps to n1ql array_containing.

Closes #1073.
Original pull request #1109.

* Support enum parameters to repository queries.

Support enums in AbstractCouchbaseConverter.convertForWriteIfNeeded().

Closes #1069.
Original pull request #1110.

Co-authored-by: mikereiche <[email protected]>
@mikereiche mikereiche requested a review from daschl March 29, 2021 21:49
@daschl
Copy link
Contributor

daschl commented Mar 30, 2021

also @mikereiche is this needed for analytics as well?

mikereiche added a commit that referenced this pull request Mar 30, 2021
com.couchbase.client.core.error.CouchbaseException: query did not project __id.
 Either use #{#n1ql.selectEntity} or project __id and __cas :
 SELECT __cas, * from `b406ab45-ef95-441f-a318-76b8e8af2d76` where iata = $1

Closes #1097.
Original pull request: #1114.
@mikereiche mikereiche force-pushed the datacouch_1097_specific_message_for_string_queries_that_dont_project_cas_id branch from 75723ca to 302e6db Compare March 30, 2021 14:45
@mikereiche
Copy link
Collaborator Author

Yes, also needed in Analytics.

com.couchbase.client.core.error.CouchbaseException: query did not project __id.
 Either use #{#n1ql.selectEntity} or project __id and __cas :
 SELECT __cas, * from `b406ab45-ef95-441f-a318-76b8e8af2d76` where iata = $1

Closes #1097.
Original pull request: #1114.
@mikereiche mikereiche force-pushed the datacouch_1097_specific_message_for_string_queries_that_dont_project_cas_id branch from 302e6db to 7854edd Compare March 30, 2021 14:53
@mikereiche mikereiche force-pushed the master branch 3 times, most recently from ef9c5f4 to d16bbff Compare March 30, 2021 21:32
String id = "";
long cas = 0;
if (row.getString(TemplateUtils.SELECT_ID) == null) {
throw new CouchbaseException("query did not project " + TemplateUtils.SELECT_ID
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should probably say in both exceptions "analytics query did not project".. to distinguish from a n1ql query in the logs if seen

@@ -0,0 +1,6 @@
package org.springframework.data.couchbase.domain;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a license header?

package org.springframework.data.couchbase.domain;

public enum Iata {
vie,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should they be VIE and XXX since we write enums upper caps?

Copy link
Contributor

@daschl daschl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nits, otherwise looks good to me

@mikereiche mikereiche force-pushed the datacouch_1097_specific_message_for_string_queries_that_dont_project_cas_id branch from 9d455a8 to 749f437 Compare April 6, 2021 14:46
…base into datacouch_1097_specific_message_for_string_queries_that_dont_project_cas_id
@mikereiche mikereiche force-pushed the datacouch_1097_specific_message_for_string_queries_that_dont_project_cas_id branch from 749f437 to 1bbf9e7 Compare April 6, 2021 14:59
@mikereiche
Copy link
Collaborator Author

minor nits, otherwise looks good to me

fixed "analytics query ..." message.
The Iata Enum needs the elements (vie) in lower-case because the (String) iata is always stored as lower-case.

@mikereiche mikereiche merged commit 9b848f6 into master Apr 6, 2021
@mikereiche mikereiche deleted the datacouch_1097_specific_message_for_string_queries_that_dont_project_cas_id branch August 11, 2021 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NullPointerException in @Query that do not project __cas . Should check for this explicitly
3 participants