What is the use of the @Temporal annotation in Hibernate?

前端 未结 7 947
北海茫月
北海茫月 2020-11-30 18:06

The Hibernate Documentation has the information below for the @Temporal annotation:

In plain Java APIs, the temporal precision of time is

7条回答
  •  遥遥无期
    2020-11-30 18:20

    We use @Temporal annotation to insert date, time or both in database table.Using TemporalType we can insert data, time or both int table.

    @Temporal(TemporalType.DATE) // insert date
    @Temporal(TemporalType.TIME) // insert time
    @Temporal(TemporalType.TIMESTAMP) // insert  both time and date.
    

提交回复
热议问题