-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Map JDK 8 type Instant to TIMESTAMP instead of LONGVARBINARY #259
Comments
p.s. also see this JPA spec issue: |
Interesting topic! Thanks for bringing this up. As was quoted from the SO post: Section 2.2 of the JPA 2.2 specification:
Since EclipseLink is the reference implementation, I don't think we should start deviating from the specification and add support for other types not listed there; like |
The issue is already there, see jakartaee/persistence#163 ;) |
Oh, lol, not sure how I missed that comment! Thanks for pointing that out. Looks like @lukasj is on top of it then. Not sure how he wants to proceed with adding support given it is omitted from the spec. Maybe this was in error and the spec was meant to support this. Not sure. |
Instant is not covered by JDBC, so is not by JPA. At least not yet. |
There's a similar issue with |
I don't know the spec lingo so I am not sure whether the phrase "may be of the following types" explicitely prohibits supporting additional types but since other implementations can do that and remain compliant I'd say you could. Ommiting |
JPA 2.2 defined that a subset of the (then) new JSR 310 date/time types were to be mapped automatically by the JPA implementation.
Unfortunately, the Instant type wasn't among those types being specified.
Hibernate and DataNucleus map these to TIMESTAMP, while EclipseLink just serialises the object into LONGVARBINARY, which makes it an opaque blob in the database.
As pre-cursor to add this forgotten type to the JPA spec, it might be good for EclipseLink to align with Hibernate and DataNucleus.
Also see this SO question:
https://stackoverflow.com/q/50142822/472792
The text was updated successfully, but these errors were encountered: