}
@Test
public void test_updateIgnoreNull() {
pojos.initData();
Platoon p = dao.fetch(Platoon.class, "sF");
p.setLeaderName("xyz");
dao.update(p);
p = dao.fetch(Platoon.class, "sF");
String name = p.getLeaderName(); // xyz
assertNotNull(name);
p.setLeaderName(null);
int re = dao.updateIgnoreNull(p);
assertEquals(1, re);
p = dao.fetch(Platoon.class, "sF");
assertEquals(name, p.getLeaderName());
p.setLeaderName(null);
dao.update(p);
p = dao.fetch(Platoon.class, "sF");
assertNull(p.getLeaderName());
p.setLeaderName("ABC");
dao.update(p);
p = dao.fetch(Platoon.class, "sF");
assertEquals("ABC", p.getLeaderName());
FieldFilter.create(Platoon.class, true).run(new Atom() {
public void run() {
System.out.println(FieldFilter.get(Platoon.class));
Platoon p = dao.fetch(Platoon.class, "sF");
p.setLeaderName(null);
dao.update(p);
}
});
p = dao.fetch(Platoon.class, "sF");
assertEquals("ABC", p.getLeaderName());
}