Repository navigation
fix(datamapping): a dynamic finder refuses text after its operator instead of dropping it - #17007
borinquenkid wants to merge 2 commits into
Conversation
…stead of dropping it findAllByRankInListOrderByName parsed as rank in a list and silently ignored OrderByName, on every datastore. calcPropertyName keeps only the text before the operator, so whatever followed it was lost. Text after an operator is now an IllegalArgumentException that names the sort and order arguments and listOrderBy*, which are the documented ways to sort. Fixes #14605 Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
…say so in the guide DynamicFinderTextAfterOperatorSpec runs on Hibernate 5, the in-memory store and MongoDB: an OrderBy suffix after GreaterThan, InList or Like is refused with a message that names the sort and order arguments, and those arguments sort the finder. The finders guide says that a finder is sorted with the parameters, not a suffix. Refs #14605 Claude-Session: https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL
jamesfredley
left a comment
There was a problem hiding this comment.
A dynamic finder with text after its operator is refused. A finder that ends on the operator still runs.
|
Retargeted from 7.0.x to 7.1.x. A dynamic finder that used to drop text after an operator silently now throws, which can break an application that worked by accident, so it does not fit 7.0.x (the patch branch, bug fixes only). 7.1.x is the lowest minor branch and merges up through 7.2.x to 8.0.x. No code changed (head bb55568) and James's approval stays on it. #17008 is stacked on this branch and follows it. |
|
Replaced by #17058 against 7.0.x on a clean branch: a call that contradicts its own name goes to the oldest branch (dev@ rule on fixes that change results), and this branch sat on an older 7.1.x base. Same code, plus an upgrade-guide note. @jamesfredley your approval here does not carry over, so please look at the new one when you can. |
A dynamic finder dropped the text after an operator it did not understand:
findAllByAgeGreaterThanOrderByNameran asfindAllByAgeGreaterThanand returned the rows unsorted, with no error.DynamicFindernow refuses the name with a message that names thesortandorderarguments, which is how a finder is sorted (findAllByAgeGreaterThan(18, [sort: 'name'])). The finders guide says so.DynamicFinderTextAfterOperatorSpecis a TCK spec: the refusal rows run through the finders ofTestEntitywithGreaterThan,InListandLikesuffixes, and the sort and order arguments sort the finder. It runs on Hibernate 5, the in-memory store and MongoDB.Full suites on this branch:
grails-datamapping-core252 tests, Hibernate 5 692, in-memory 574, MongoDB 573 (2 workers), 0 failures.Fixes #14605
https://claude.ai/code/session_01Dmki4RzWwreEC2GkkyFnvL