jakartaee / jakartaee/persistence

comparison operators are not meaningful for times

Open Beginner friendly
#1,126 1 comment 0 reactions 0 assignees View on GitHub
4.0.0
Dominant language
Java
Stars
267
Forks
78
Avg merge
1d 6h
Merged PRs (30d)
13

Description

We should clarify in the spec that the `<`, `>`, `<=`, and `>=` operators are not defined for `LocalTime`.

Why not? Well, because:

1. Time of day doesn't have a meaningful total order. Times form a topological circle. It's not meaningful to say that 23:59:59 > 00:00:00. That's just completely arbitrary. Is the first time a day after or one second before the second time? You need a date to know for sure.
2. Oracle has no ANSI-like `TIME` type, and to emulate it requires jumping through really disgusting hoops.

Contributor guide

Open the contributing guide

Research direction

Start with the persistence specification section covering LocalTime and its comparison operators. Clarify that <, >, <=, and >= are not defined for LocalTime, preserving the rationale in the issue; done means the specification states this unambiguously.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.