2.7.61 @Temporal

Organization of this subsection
(1) Description
(2) Element

(1) Description

This annotation is specified in the persistence property or persistence field having the type that expresses the time (java.util.Date and java.util.Calendar). This annotation can be used along with @Basic.

However, @Version and @Temporal cannot be specified concurrently. Specify either of these annotations.

The applicable targets are method and field.

(2) Element

The following table lists the elements of @Temporal:

Element nameOptional/RequiredElement description
valueRequiredThis element is specified in the TemporalType enumeration type corresponding to the database type.

The details of attributes that are supported with Cosminexus JPA provider are as follows:

(a) value element
Type
TemporalType
Description
This element is specified in the TemporalType enumeration type corresponding to the database type.
The following three types of values can be specified:
  • TemporalType.DATE: Same as java.sql.Data.
  • TemporalType.TIME: Same as java.sql.Time.
  • TemporalType.TIMESTAMP: Same as java.sql.Timestamp.
Default value
None