@Test
public void testPkfieldsblobs() {
SqlSession sqlSession = sqlSessionFactory.openSession();
try {
PkfieldsblobsMapper mapper = sqlSession.getMapper(PkfieldsblobsMapper.class);
Pkfieldsblobs record = new Pkfieldsblobs();
record.setId1(1);
record.setId2(1);
record.setBlob1(TestUtilities.generateRandomBlob());
int rows = mapper.insert(record);
assertEquals(1, rows);
record = new Pkfieldsblobs();
record.setId1(2);
record.setId2(2);
record.setBlob1(TestUtilities.generateRandomBlob());
rows = mapper.insert(record);
assertEquals(1, rows);
List<Pkfieldsblobs> records = mapper.selectAll();
assertEquals(2, records.size());
Pkfieldsblobs returnedRecord = mapper.selectByPrimaryKey(record.getId1(), record.getId2());
assertNotNull(returnedRecord);
assertTrue(TestUtilities.blobsAreEqual(record.getBlob1(), returnedRecord.getBlob1()));
record.setBlob1(TestUtilities.generateRandomBlob());
rows = mapper.updateByPrimaryKey(record);
assertEquals(1, rows);
returnedRecord = mapper.selectByPrimaryKey(record.getId1(), record.getId2());
assertNotNull(returnedRecord);
assertTrue(TestUtilities.blobsAreEqual(record.getBlob1(), returnedRecord.getBlob1()));
rows = mapper.deleteByPrimaryKey(record.getId1(), record.getId2());
assertEquals(1, rows);
records = mapper.selectAll();
assertEquals(1, records.size());
} finally {
sqlSession.close();
}