Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@njr-11
Copy link
Contributor

@njr-11 njr-11 commented Feb 5, 2025

Adds implementation of toString on the built-in Restrictions to display in a concise way that is meaningful.

For example,
name LIKE "Jakarta EE %"
Or,
ALL (price GREATER_THAN_EQUAL 50, price LESS_THAN 100)

@njr-11 njr-11 added this to the 1.1 milestone Feb 5, 2025
*/
@Override
public String toString() {
StringBuilder s = new StringBuilder();
Copy link
Contributor

Choose a reason for hiding this comment

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

If possible, avoid variables like s, please, use something like:

textExpression

or any variation like this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I renamed it in the latest commit.

@otaviojava otaviojava merged commit e88d08e into jakartaee:main Feb 6, 2025
4 checks passed
@gavinking
Copy link
Contributor

ALL (price GREATER_THAN_EQUAL 50, price LESS_THAN 100)

Why not align the toString()s with the equivalent JDQL, so:

(price >= 50 AND price < 100)

@gavinking
Copy link
Contributor

Oh, wait, it was already merged? A bit quick, no? I think we should always leave time for reviews/feedback.

@njr-11
Copy link
Contributor Author

njr-11 commented Feb 6, 2025

ALL (price GREATER_THAN_EQUAL 50, price LESS_THAN 100)

Why not align the toString()s with the equivalent JDQL, so:

(price >= 50 AND price < 100)

That's a nice improvement, and I like how it is more concise.

Oh, wait, it was already merged? A bit quick, no? I think we should always leave time for reviews/feedback.

I suppose he didn't realize I only created the PR yesterday? I guess we'll use a separate PR for the improvement.

@gavinking
Copy link
Contributor

OK, perfect.

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.

3 participants