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一直为空,为什么?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
设置默认值为当前时间
create_time datetime DEFAULT CURRENT_TIMESTAMP COMMENT '批次创建时间'或者
create_time timestamp DEFAULT CURRENT_TIMESTAMP COMMENT '批次创建时间'