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

前端 未结 7 974
北海茫月
北海茫月 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:40

    If you're looking for short answer:

    In the case of using java.util.Date, Java doesn't really know how to directly relate to SQL types. This is when @Temporal comes into play. It's used to specify the desired SQL type.

    Source: Baeldung

提交回复
热议问题