Skip to content

Add H2 Interval converters for Duration#2299

Open
yeomin4242 wants to merge 1 commit into
spring-projects:mainfrom
yeomin4242:main
Open

Add H2 Interval converters for Duration#2299
yeomin4242 wants to merge 1 commit into
spring-projects:mainfrom
yeomin4242:main

Conversation

@yeomin4242
Copy link
Copy Markdown

Closes spring-projects/spring-data-r2dbc#502

Add H2 Interval to Duration conversion support to the R2DBC H2 dialect.

This follows the feedback from #2248 by using the H2 API directly instead of reflection, while guarding registration by classpath presence.

Changes include:

  • registering org.h2.api.Interval as a dialect simple type when H2 is available
  • adding Interval -> Duration and Duration -> Interval converters
  • supporting H2 day-time intervals and rejecting year-month intervals that cannot be represented as Duration
  • adding unit and integration tests for simple type registration, conversion, writing, and H2 round-tripping

com.h2database:h2 is added as an optional dependency because the converters directly use org.h2.api.Interval, which is provided by the H2 artifact.

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

Signed-off-by: YeongJae Min <whereismysejong@naver.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add H2 Interval to Duration converters to H2Dialect

2 participants