public void testPKBlobsUpdateByPrimaryKeySelective() {
SqlSession sqlSession = sqlSessionFactory.openSession();
try {
PkblobsMapper mapper = sqlSession.getMapper(PkblobsMapper.class);
PkblobsWithBLOBs record = new PkblobsWithBLOBs(3, generateRandomBlob(), generateRandomBlob(),
"Long String 1");
mapper.insert(record);
PkblobsWithBLOBs newRecord = new PkblobsWithBLOBs(3, null, generateRandomBlob(),
"Long String 2");
mapper.updateByPrimaryKeySelective(newRecord);
PkblobsKey key = new PkblobsKey(3);
PkblobsWithBLOBs returnedRecord = mapper.selectByPrimaryKey(key);
assertNotNull(returnedRecord);
assertEquals(record.getId(), returnedRecord.getId());
assertTrue(blobsAreEqual(record.getBlob1(), returnedRecord
.getBlob1()));
assertTrue(blobsAreEqual(newRecord.getBlob2(), returnedRecord
.getBlob2()));
assertEquals(newRecord.getCharacterlob(), returnedRecord.getCharacterlob());
} finally {
sqlSession.close();
}
}