-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Avoid double-parenthesis in JpqlQueryBuilder.InPredicate
rendering
#3962
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
Prevent duplicate parentheses when rendering IN/NOT IN predicates with expressions that already contain parentheses. Added logic to check if predicate string starts and ends with parentheses before wrapping with additional parentheses. This change improves JPQL query readability by avoiding patterns like "field IN (('value1', 'value2'))" and ensures proper syntax for subqueries and already-parenthesized expressions. Added comprehensive unit tests to verify the fix handles various scenarios including regular expressions, pre-parenthesized expressions, and subquery expressions. Signed-off-by: Choi Wang Gyu <dhkdrb897@gmail.com>
I'm not sure if the code formatting has been properly applied. |
There are still more formatting-related changes than those concerning the actual change. Please make sure to reduce or remove all formatting-related changes, otherwise, this PR creates more work for us than addressing the issue ourselves. |
Yes, I’ve removed it. |
Awesome, thank you. |
JpqlQueryBuilder.InPredicate
rendering
Thank you for your contribution. That's merged and polished now. The formatting changes originate from us not applying consistently our formatting style. Additionally, I have simplified the tests slightly. |
Prevent duplicate parentheses when rendering IN/NOT IN predicates with expressions that already contain parentheses. Added logic to check if predicate string starts and ends with parentheses before wrapping with additional parentheses. This change improves JPQL query readability by avoiding patterns like "field IN (('value1', 'value2'))" and ensures proper syntax for subqueries and already-parenthesized expressions. Added comprehensive unit tests to verify the fix handles various scenarios including regular expressions, pre-parenthesized expressions, and subquery expressions. Signed-off-by: Choi Wang Gyu <dhkdrb897@gmail.com> Closes #3961 Original pull request: #3962
Prevent duplicate parentheses when rendering IN/NOT IN predicates with expressions that already contain parentheses. Added logic to check if predicate string starts and ends with parentheses before wrapping with additional parentheses.
This change improves JPQL query readability by avoiding patterns like "field IN (('value1', 'value2'))" and ensures proper syntax for subqueries and already-parenthesized expressions.
Added comprehensive unit tests to verify the fix handles various scenarios including regular expressions, pre-parenthesized expressions, and subquery expressions.