The Hibernate Documentation has the information below for the @Temporal annotation:
In plain Java APIs, the temporal precision of time is
@Temporal is a JPA annotation which can be used to store in the database table on of the following column items:
java.sql.Date)java.sql.Time)java.sql.Timestamp)Generally when we declare a Date field in the class and try to store it.
It will store as TIMESTAMP in the database.
@Temporal
private Date joinedDate;
Above code will store value looks like 08-07-17 04:33:35.870000000 PM
If we want to store only the DATE in the database,
We can use/define TemporalType.
@Temporal(TemporalType.DATE)
private Date joinedDate;
This time, it would store 08-07-17 in database
There are some other attributes as well as @Temporal which can be used based on the requirement.