I recently studied hibernate annotations, but when I used the @temporal annotation, I initially assumed that the value of the property would be automatically assigned after the label was used. It is not necessary to assign a value to the property when inserting the data, which is not the case through repeated research.
The role of @Temporal tags is simple:
(1) If there is a date type attribute in a class, the database store may be ' yyyy-mm-dd hh:MM:ss ' to get the month and year date at the time of the query, and the label @temporal (temporaltype.date) on that attribute will get a shape like ' Date in YYYY-MM-DD ' format.
(2) If there is a date type attribute in a class, the storage in the database may be ' yyyy-mm-dd hh:MM:ss ' to obtain seconds and minutes, and the label on the attribute @Temporal (temporaltype.time) will get the shape as ' HH:MM:SS ' The date of the format.
(3) If there is a date type attribute in a class, the database store may be ' yyyy-mm-dd hh:MM:ss ' to obtain ' is ' yyyy-mm-dd hh:MM:ss ', on which the attribute is labeled @Temporal ( Temporaltype.timestamp) will get a date shaped like ' HH:MM:SS ' format
Use of Hibernate @Temporal