Skip to content

make ComparableExpressions sortable#1455

Open
gavinking wants to merge 1 commit into
jakartaee:mainfrom
gavinking:sortable-expressions
Open

make ComparableExpressions sortable#1455
gavinking wants to merge 1 commit into
jakartaee:mainfrom
gavinking:sortable-expressions

Conversation

@gavinking
Copy link
Copy Markdown
Member

This had a bigger impact than I expected.

Question: do we need SortableExpression?

@gavinking gavinking requested review from njr-11 and otaviojava May 20, 2026 18:23
Comment on lines +223 to 224
@Deprecated(since = "1.1", forRemoval = true)
public Sort(String property, boolean isAscending, boolean ignoreCase) {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👀

Comment on lines -91 to +86
public record Sort<T>(String property,
boolean isAscending,
boolean ignoreCase,
Nulls nullOrdering) {
public final class Sort<T> {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👀

Copy link
Copy Markdown
Member

@njr-11 njr-11 left a comment

Choose a reason for hiding this comment

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

I'd rather not introduce Sortable. It doesn't do anything useful for the end user and I don't think we need it. I wanted to try out adding the asc/desc methods to ComparableExpression and the ascIgnoreCase/descIgnoreCase methods to TextExpression. This seems to work fine in a commit of 1400 where I tried it out. I created a couple of new unit tests to verify it as well as updating the test that were previously under 1400 so they test navigable expressions rather than navigable attributes. That all seemed to work.

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.

Missing a way to statically reference a sort by an embedded or associated property

2 participants