create_time datetime DEFAULT NULL COMMENT '批次创建时间'
update_time datetime DEFAULT NULL COMMENT '最后更新时间'
record.setCreateTime(new Date());
record.setUpdateTime(new Date());
使用hibernate保存record对象,update_time的值保存到数据库了,但是create_time一直为空,为什么?
create_time datetime DEFAULT NULL COMMENT '批次创建时间'
update_time datetime DEFAULT NULL COMMENT '最后更新时间'
record.setCreateTime(new Date());
record.setUpdateTime(new Date());
使用hibernate保存record对象,update_time的值保存到数据库了,但是create_time一直为空,为什么?
5 回答1.5k 阅读
2 回答2.2k 阅读
3 回答762 阅读✓ 已解决
1 回答1k 阅读
1 回答694 阅读✓ 已解决
1 回答994 阅读
1 回答866 阅读
设置默认值为当前时间
create_time datetime DEFAULT CURRENT_TIMESTAMP COMMENT '批次创建时间'
或者
create_time timestamp DEFAULT CURRENT_TIMESTAMP COMMENT '批次创建时间'