public void testPKFieldsUpdateByPrimaryKeySelective() {
SqlSession sqlSession = sqlSessionFactory.openSession();
try {
PkfieldsMapper mapper = sqlSession.getMapper(PkfieldsMapper.class);
Pkfields record = new Pkfields();
record.setFirstname("Jeff");
record.setLastname("Smith");
record.setDecimal60field(5);
record.setId1(1);
record.setId2(2);
mapper.insert(record);
Pkfields newRecord = new Pkfields();
newRecord.setId1(1);
newRecord.setId2(2);
newRecord.setFirstname("Scott");
newRecord.setDecimal60field(4);
int rows = mapper.updateByPrimaryKeySelective(newRecord);
assertEquals(1, rows);
PkfieldsKey key = new PkfieldsKey();
key.setId1(1);
key.setId2(2);
Pkfields returnedRecord = mapper.selectByPrimaryKey(key);
assertTrue(datesAreEqual(record.getDatefield(), returnedRecord
.getDatefield()));
assertEquals(record.getDecimal100field(), returnedRecord
.getDecimal100field());
assertEquals(record.getDecimal155field(), returnedRecord
.getDecimal155field());
assertEquals(record.getDecimal30field(), returnedRecord
.getDecimal30field());
assertEquals(newRecord.getDecimal60field(), returnedRecord
.getDecimal60field());
assertEquals(newRecord.getFirstname(), returnedRecord
.getFirstname());
assertEquals(record.getId1(), returnedRecord.getId1());
assertEquals(record.getId2(), returnedRecord.getId2());
assertEquals(record.getLastname(), returnedRecord.getLastname());
assertTrue(timesAreEqual(record.getTimefield(), returnedRecord
.getTimefield()));
assertEquals(record.getTimestampfield(), returnedRecord
.getTimestampfield());
} finally {
sqlSession.close();
}
}