I used Criteria to select record. I hope h2 ingore this condition when argument is null.
e.g.
crit.add(Expression.ge("inputDate", model.getSearchBeginDate()));
if model.getSearchBeginDate() == null, I hope h2 ingore this condition.
How can I config it or I should judge null value by myself?
By the way sometime when I update record, I also want h2 to remain origin value if new field value is null.
e.g.
session.update(model);
if model.getField1()==null(Field1 is not key), I want remain origin value of this field in database, not set to null.
Can I simply config something to archive it?
|