fail(e.getMessage());
}
}
public void testPKFieldsUpdateByExample() {
PkfieldsDAO dao = getPkfieldsDAO();
try {
Pkfields record = new Pkfields();
record.setFirstname("Jeff");
record.setLastname("Smith");
record.setId1(new Integer(1));
record.setId2(new Integer(2));
dao.insert(record);
record = new Pkfields();
record.setFirstname("Bob");
record.setLastname("Jones");
record.setId1(new Integer(3));
record.setId2(new Integer(4));
dao.insert(record);
record = new Pkfields();
record.setFirstname("Fred");
record.setId1(new Integer(3));
record.setId2(new Integer(4));
PkfieldsExample example = new PkfieldsExample();
example.createCriteria()
.andId1EqualTo(new Integer(3))
.andId2EqualTo(new Integer(4));
int rows = dao.updateByExample(record, example);
assertEquals(1, rows);
example.clear();
example.createCriteria()
.andFirstnameEqualTo("Fred")
.andLastnameIsNull()
.andId1EqualTo(new Integer(3))
.andId2EqualTo(new Integer(4));
rows = dao.countByExample(example);
assertEquals(1, rows);
} catch (SQLException e) {
fail(e.getMessage());
}
}