Skip to content

DATACOUCH-603 - Do not cast query parameters in N1qlQueryCreator. #263

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

Merged

Conversation

mikereiche
Copy link
Collaborator

For IN and NOT_IN - they can take varargs, and array or a JsonArray

  • don't cast the parameter, let parameter accessor handle that.
  • JsonArray.toString() provides the brackets, don't include them in the format
  • Object[] array needs explicit conversion, as toString() is not sufficient

Also cleaned up some weirdness in QueryCriteria.

  • 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).

@mikereiche mikereiche requested a review from daschl September 17, 2020 02:06
@mikereiche mikereiche force-pushed the datacouch_603_n1qlquerycreator_dont_cast_parameters branch 2 times, most recently from 2108e66 to d3969d0 Compare October 6, 2020 01:39
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.

looks good overall, just one note on a test

@@ -62,6 +63,35 @@ void createsQueryCorrectly() throws Exception {
assertEquals(query.export(), " WHERE " + where("firstname").is("Oliver").export());
}

@Test
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it make sense to add another test for List?

@mikereiche mikereiche force-pushed the datacouch_603_n1qlquerycreator_dont_cast_parameters branch from d3969d0 to 5b3e888 Compare October 8, 2020 23:15
For IN and NOT_IN - they can take varargs, an array or a JsonArray
Don't cast query criteria parameters, let parameter accessor handle that.
Fixed conversion of query criteria values to parameters
Cleaned up QueryCriteria
@mikereiche mikereiche force-pushed the datacouch_603_n1qlquerycreator_dont_cast_parameters branch from 5b3e888 to 0f7e9a0 Compare October 8, 2020 23:43
For IN and NOT_IN - they can take varargs, and array or a JsonArray
don't cast the parameter, let parameter accessor handle that.
JsonArray.toString() provides the brackets, don't include them in the format
Object[] array needs explicit conversion, as toString() is not sufficient
Also cleaned up some weirdness in QueryCriteria.
@mikereiche mikereiche force-pushed the datacouch_603_n1qlquerycreator_dont_cast_parameters branch from 4d841fa to d57d136 Compare October 9, 2020 21:50
@mikereiche mikereiche merged commit 1b5c321 into master Oct 9, 2020
@mikereiche mikereiche changed the title DATACOUCH-603 Do not cast query parameters in N1qlQueryCreator. DATACOUCH-603 - Do not cast query parameters in N1qlQueryCreator. Oct 12, 2020
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.

2 participants