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 CURRENT_TIMESTAMP COMMENT '批次创建时间'
或者create_time timestamp DEFAULT CURRENT_TIMESTAMP COMMENT '批次创建时间'