public void testPKFieldsInsert() {
SqlSession sqlSession = sqlSessionFactory.openSession();
try {
PkfieldsMapper mapper = sqlSession.getMapper(PkfieldsMapper.class);
Pkfields record = new Pkfields();
record.setDatefield(new Date());
record.setDecimal100field(10L);
record.setDecimal155field(new BigDecimal("15.12345"));
record.setDecimal30field((short) 3);
record.setDecimal60field(6);
record.setFirstname("Jeff");
record.setId1(1);
record.setId2(2);
record.setLastname("Butler");
record.setTimefield(new Date());
record.setTimestampfield(new Date());
record.setStringboolean(true);
mapper.insert(record);
Pkfields returnedRecord = mapper.selectByPrimaryKey(2, 1);
assertNotNull(returnedRecord);
assertTrue(datesAreEqual(record.getDatefield(), returnedRecord
.getDatefield()));
assertEquals(record.getDecimal100field(), returnedRecord
.getDecimal100field());
assertEquals(record.getDecimal155field(), returnedRecord
.getDecimal155field());
assertEquals(record.getDecimal30field(), returnedRecord
.getDecimal30field());
assertEquals(record.getDecimal60field(), returnedRecord
.getDecimal60field());
assertEquals(record.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());
assertEquals(record.isStringboolean(), returnedRecord.isStringboolean());
} finally {
sqlSession.close();
}
}