I have a non null column defined with a default:
@DatabaseField(dataType = DataType.TIME_STAMP, columnDefinition = "DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL")
private Date createdDate;
When trying to save a row with the createdDate
field unset, I get the following error:
[SQLITE_CONSTRAINT_NOTNULL] A NOT NULL constraint failed (NOT NULL constraint failed:
ORMLite is probably trying to explicitly insert a NULL
value into the field. Adding persisted = false
to the annotation avoids this, but then the column isn't being created on table creation.
Is there a way to create the column, but to also tell ORMLite to ignore that column on INSERT?