For the following, I think this is desirable:
3) each field should be set as far as possible not to be empty. For some businesses such as the Order's warehouse picking time, it is required to wait until the warehouse picking scan to have a value;
Reference solutions:
All fields are set to not null,
The int, date, datetime, and timestamp types can all be set to default 0.
The following is added to the orm layer Configuration:
ZeroDateTimeBehavior = convertToNull
In this way, no changes are required at the code level. ()
This trick is desirable when database-level optimization is taken into account and a large amount of data is concurrent,
Second, consider tms business.
Time is tight, which can be applied to large tables.
Ps:
Set datetime = null it will be cleared to 0 .., yes ,., But the standards cannot be unified.
Change all time-related values to not null default 0 .. the code changes UPDATE seq_rule SET test_date = null to UPDATE seq_rule SET test_date = 0.
In this way, all time types can be unified.
Db alone
Timestamp type + not null default 0. + UPDATE seq_rule SET test_date = 0
Can it be solved at the java level?