Open issues

Support JDBC 4.2

Description

See https://github.com/JadiraOrg/jadira/issues/12

Its a big issue and will not be implemented in Jadira for a small while. Also, you won't be able to make use of this without a database with a 4.2 driver. In (quite a long) time JPA will remove the need for some of the custom mappings, although again, it will depend on driver support.

This link is very relevant as it explains the cases we need to support to evolve to the best forward compatibility:

https://java.net/jira/browse/JPA_SPEC-63

1) Detection of whether a JDBC 4.2 driver is being used - types marked * below cannot be used without the 4.2 driver, whilst types marked + can have either legacy or 4.2 behaviour. A system property or parameter on any type that can use either 4.2 behaviour or old behaviour should be available to force either legacy or 4.2 type mapping, but if it is not specified the 4.2 behaviour will be the default behaviour where available. Note that driver support for specific types can be enumerated by using DatabaseMetadata.getTypeInfo().
2) PersistentDayOfWeek should be renamed to PersistentDayOfWeekAsInteger and a new PersistentDayOfWeek type () introduced. This should map to the DAY_OF_WEEK type using setObject
3) PersistentDurationAsString to be supplemented with PersistentDuration () mapped to DURATION, PersistentDurationAsDecimal (fields storing the seconds before the decimal point and the nanoseconds after the decimal point) and PersistentDurationAsInteger (stores the seconds)
4) PersistentInstantAsTimestamp to be updated to use setObject by default, falling back to the current behaviour if 4.2 not detected or specified.
5) PersistentLocalDate to be updated to use setObject by default, falling back to the current behaviour if 4.2 not detected or specified.
6) PersistentLocalDateTime to be updated to use setObject by default, falling back to the current behaviour if 4.2 not detected or specified.
7) PersistentLocalTime to be updated to use setObject by default, falling back to the current behaviour if 4.2 not detected or specified.
8) PersistentMonth should be renamed to PersistentMonthAsInteger and a new PersistentMonth type () introduced. This should map to the MONTH type using setObject
9) Add PersistentMonthDay to map to MONTHDAY () and PersistentMonthDayAsDate and PersistentMonthDayAsTimestamp to supplement existing PersistentMonthDayAsString
10) PersistentOffsetDateTime to be updated to use setObject by default, falling back to the current behaviour if 4.2 not detected or specified. In addition the type should accept the @javax.persistence.TemporalIncludeTimeZone annotation in addition to the existing parameters
11) PersistentOffsetTimeAsTime to be renamed as PersistentOffsetTime , also to be updated to use setObject by default, falling back to the current behaviour if 4.2 not detected or specified.In addition the type as well as PersistentOffsetTimeAsTimestamp should accept the javax.persistence.TemporalIncludeTimeZone annotation in addition to the existing parameters
12) PersistentPeriodAsString to be supplemented with PersistentPeriod () mapped to PERIOD, PersistentPeriodAsDuration () mapped to DURATION, PersistentPeriodAsDecimal (fields storing the seconds before the decimal point and the nanoseconds after the decimal point) and PersistentPeriodAsInteger (stores the seconds)
13) PersistentYear should be renamed to PersistentYearAsInteger and a new PersistentYear to YEAR type () and PersistentYearAsString introduced.
14) PersistentZonedDateTime to be updated to use setObject by default, falling back to the current behaviour if 4.2 not detected or specified. In addition the type should accept the @javax.persistence.TemporalIncludeTimeZone annotation in addition to the existing parameters
15) PersistentZoneId () to be added, mapping to TIMEZONE
16) PersistentZoneOffset to be added, mapping to OFFSET

NB Some more thought about the offset types in 4.2 is needed. Probably multi column types with zone / zone offset are also needed.

Environment

None

Status

Assignee

ChrisP

Reporter

ChrisP

Labels

None

Components

Fix versions

Affects versions

3.1.0.GA

Priority

Major