2.13.8.1.3. Temporal Types

The Temporal annotation determines how the implementation handles your basic java.util.Date and java.util.Calendar fields at the JDBC level. The Temporal annotation’s value is a constant from the TemporalType enum. Available values are:

  • TemporalType.TIMESTAMP: The default. Use JDBC’s timestamp APIs to manipulate the column data.

  • TemporalType.DATE: Use JDBC’s SQL date APIs to manipulate the column data.

  • TemporalType.TIME: Use JDBC’s time APIs to manipulate the column data.

If the Temporal annotation is omitted, the implementation will treat the data as a timestamp.

The corresponding XML element is temporal, whose text value must be one of: TIME, DATE, or TIMESTAMP.