Introduce Java types for SQL Interval types #4892
beikov
started this conversation in
Design Proposals
Replies: 2 comments 2 replies
-
|
According to our existing ideology, this wouldn’t belong in core, but in something analogous to hibernate-spatial or that hibernate types project i have never looked at. Of course, ideology can change… |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
I propose we add a new sub module to Hibernate for these things and propose the module name |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The SQL Standard has
interval Xandinterval X to Ytypes, which can be seen as wrappers aroundnumericwhere theYpart is the fractional part. I propose to add Java types to Hibernate for these interval types, which extendjava.lang.Number. These special types will receive some methods to interact withTemporaltypes and map to the corresponding SQLintervaltypes, ornumeric/decimalas fallback.Since Oracle only supports 2 interval types, I would suggest we limit ourselves to these for now:
YearToMonthIntervalforinterval year to monthDayToSecondIntervalforinterval day to secondfor a precision up to nanosecondsWe can add others later though if needed and emulate these through the
numerictype then.As a side note, we already support the type
interval secondwhichjava.time.Durationmaps to if possible.Beta Was this translation helpful? Give feedback.
All reactions