This commit is contained in:
Michael Bayne
2008-04-25 18:32:44 +00:00
parent 4eb7d9ecd3
commit 31b886aed2
@@ -702,8 +702,8 @@ public class DepotMarshaller<T extends PersistentRecord>
// TIMESTAMP columns a value of "0000-00-00 00:00:00" regardless of whether we // TIMESTAMP columns a value of "0000-00-00 00:00:00" regardless of whether we
// explicitly provide a "DEFAULT" value for the column or not, and DATETIME columns // explicitly provide a "DEFAULT" value for the column or not, and DATETIME columns
// cannot accept CURRENT_TIME or NOW() defaults at all. // cannot accept CURRENT_TIME or NOW() defaults at all.
if (coldef.getType().equalsIgnoreCase("timestamp") || if (!coldef.isNullable() && (coldef.getType().equalsIgnoreCase("timestamp") ||
coldef.getType().equalsIgnoreCase("datetime")) { coldef.getType().equalsIgnoreCase("datetime"))) {
log.info("Assigning current time to " + fmarsh.getColumnName() + "."); log.info("Assigning current time to " + fmarsh.getColumnName() + ".");
ctx.invoke(new Modifier.Simple() { ctx.invoke(new Modifier.Simple() {
protected String createQuery (DatabaseLiaison liaison) { protected String createQuery (DatabaseLiaison liaison) {