In plain Java APIs, the temporal
precision of time is not defined. When
dealing with temporal data you might
want to describe the expected
precision in database. Temporal data
can have DATE, TIME, or TIMESTAMP
precision (ie the actual date, only
the time, or both). Use the @Temporal
annotation to fine tune that.
@Temporal(TemporalType.TIMESTAMP)
private Date someDate;
# 1 楼答案
可以使用@Temporal注释标记日期对象: