jakartaee / jakartaee/data

[Use Case]: Sort collation

Open
#1,445 12 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
150
Forks
37
Avg merge
4d 4h
Merged PRs (30d)
34

Description

### As a ...

- [ ] Application user/user of the configuration itself
- [x] API user (application developer)
- [ ] SPI user (container or runtime developer)
- [ ] Specification implementer

### I need to be able to ...

Specify how comparisons and ordering are collated, such as by specifying a locale

### Which enables me to ...

Handle more fine-grained ordering of strings.

### Additional information

Using the `Sort` API, I can specify case insensitivity: https://jakarta.ee/specifications/data/1.1/apidocs/jakarta.data/jakarta/data/sort

But we've had users who expect to be able ot specify how the case sensitivity is collated, such as specifying the locale to use for ordering.

See https://github.com/quarkusio/quarkus/issues/31254

This is coming from an original Mongo/Panache implementation which supports this, but we know Hibernate ORM also supports collation.

@yrodiere suggested that besides ordering, this might be useful as a query parameter too:

```java
@Find
List books(@Collate("ucs_basic") String title);
```

Perhaps we should handle this use-case as well?

Contributor guide

Open the contributing guide

Research direction

Start with the Jakarta Data Sort API linked in the issue, then compare the referenced Quarkus issue and the Mongo/Panache and Hibernate ORM collation support. Clarify whether collation belongs in Sort, query parameters such as @Collate, or both. Done means the supported API and collation semantics are agreed and documented sufficiently for implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.