Comparators for grid columns sorting
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
I'm using a backend persistence framework which expose SQL tables as Streams and builds SQL queries with its own implementation of Predicate and Comparator.
I thought this would create a perfect match with FW8 data providers, but I'm facing some difficulties with sorting, since the QuerySortOrder only provides strings to identify the properties, where a stream wants a Comparator.
I know Query has a getInMemorySorting() which return a Comparator, but how to set a particular comparator for a column? There's a setComparator(SerializableComparator comparator), but I cannot pass a custom implementation of Comparator, nor can I use the suggested comparator::compare since that will return a new object and not the backend-optimized implementation.
I'm suggesting here to decouple Query from SortOrder<String> and let the developer decide to use, for example, SortOrder<Comparator<T>>.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading Query, QuerySortOrder, and SerializableComparator, especially Query.getInMemorySorting() and setComparator(SerializableComparator). Determine how sorting is represented across data providers and what API shape can support backend-specific comparators. Done means a decided, compatible design for column comparators, with affected behavior and tests identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100