我在oracle表中定义了一个时间字段: StartTime DATE DEFAULT(sysdate) NOT NULL, 在xxx.hbm.xml中也进行了定义此字段. 在保存数据的时候,由于我定义的"DEFAULT(sysdate)",所以 没有用set方法来保存start_time字段.这样系统报"不能把null值插入数据库". 可以使用: student.setStartTime (new Date(System.currentTimeMillis())); 系统就不会报错了,但我不能数据库函数sysdate了.有什么其他的解决办法吗?
dynamic-insert (optional, defaults to false): Specifies that INSERT SQL should be generated at runtime and contain only the columns whose values are not null.