-
Notifications
You must be signed in to change notification settings - Fork 3.6k
HHH-15142 Conversion of CriteriaQuery to TypedQuery with Like predicate and escape character fails when repeated. #4970
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
criteriaBuilder.like( | ||
root.get( Wallet_.model ), | ||
stringValueParameter, | ||
'/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be wrong; but it seems the reported issue is preconditioned by 'escaped char', not normal '/' char?
Below is the original code snippet:
CriteriaQuery<Person> criteriaQuery = personQuery .where(cb.like(
root.get("name"),
pattern,
cb.literal('\\')
));
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It wasn't a syntax error caused by Criteria→JPQL→internal conversion, it happened during parameter binding.
Two other test cases don't have anything about escaping (the use Instant literals), but still fail before the fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NathanQingyangXu , I do not think the gist of the issues is this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it, thanks for letting me know.
It might be an idea to modify the ticket title and description to perfectly remove all misleading irrelevant factors, for future bug reporter might get confused if he searched for similar bugs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by the way I added an additional test
219807a
to
ec5bc16
Compare
…java.lang.IllegalArgumentException: Parameter value [] did not match expected type [java.lang.String (n/a)]
Is there any planned release date for 5.6.9? |
https://hibernate.atlassian.net/browse/HHH-15142