@Table(name="Article")
@Access(value = AccessType.FIELD)
public class Articles implements Serializable {
private static final long serialVersionUID = -6652995014527706545L;
public Articles() {
OffsetDateTime dateTime = OffsetDateTime.now();
// Timestamp timestamp = Timestamp.valueOf(dateTime.atZoneSameInstant(ZoneId.of("Z")).toLocalDateTime());
this.timeStamp = dateTime;
}
@Column(name = "timeStamp")
@Access(value = AccessType.FIELD)
private OffsetDateTime timeStamp;
public OffsetDateTime getTimeStamp() {
return timeStamp;
}
public void setTimeStamp(OffsetDateTime timeStamp) {
}
我几乎没有其他类变量,但只有在添加timeStamp变量后,我才遇到这个问题
答案 0 :(得分:0)
确定。我自己找到了。使用java.time导入是个问题。我应该使用sql.time。它解决了它。