Skip to content

Sort for path attributes#1400

Open
njr-11 wants to merge 2 commits intojakartaee:mainfrom
njr-11:sort-for-navigable-attributes
Open

Sort for path attributes#1400
njr-11 wants to merge 2 commits intojakartaee:mainfrom
njr-11:sort-for-navigable-attributes

Conversation

@njr-11
Copy link
Member

@njr-11 njr-11 commented Mar 12, 2026

The Sort methods for metamodel attributes are missing from the Path attributes for when the NavigableAttribute pattern is used. This PR looks into adding them by having the navigate(*Attribute) methods now return *Attribute. To do that, the respective *Path classes are switched to be a *Attribute rather than only a *Expression. With these changes, you can now get a .name() from the path classes like NumericPath, and because it now inherits NumericAttribute rather than just NumericExpression, we also get the default asc() and desc() methods that are based on the name(). The same is true for the other sortable types, and with TextPath, we also inherit the default IgnoreCase variants of the asc/desc methods.

I added a unit test with navigation to each of the path types, demonstrating that Sorts are now successfully obtained.

@njr-11 njr-11 added this to the 1.1 milestone Mar 12, 2026
@otaviojava otaviojava requested a review from gavinking March 18, 2026 13:37
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.

1 participant