public void testMyObjectSelectByExampleTimeEquals() {
SqlSession sqlSession = sqlSessionFactory.openSession();
try {
MyObjectMapper mapper = sqlSession.getMapper(MyObjectMapper.class);
MyObject record = new MyObject();
record.setStartDate(new Date());
record.setDecimal100field(10L);
record.setDecimal155field(15.12345);
record.setDecimal60field(6);
FirstName fn = new FirstName();
fn.setValue("Jeff");
record.setFirstname(fn);
record.setId1(1);
record.setId2(2);
record.setLastname("Butler");
MyTime myTime = new MyTime();
myTime.setHours(12);
myTime.setMinutes(34);
myTime.setSeconds(05);
record.setTimefield(myTime);
record.setTimestampfield(new Date());
mapper.insert(record);
MyObjectCriteria example = new MyObjectCriteria();
example.createCriteria().andTimefieldEqualTo(myTime);
List<MyObject> results = mapper.selectByExample(example);
assertEquals(1, results.size());
MyObject returnedRecord = results.get(0);
assertTrue(datesAreEqual(record.getStartDate(), returnedRecord
.getStartDate()));
assertEquals(record.getDecimal100field(), returnedRecord
.getDecimal100field());
assertEquals(record.getDecimal155field(), returnedRecord
.getDecimal155field());
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());
assertEquals(record.getTimefield(), returnedRecord.getTimefield());
assertEquals(record.getTimestampfield(), returnedRecord
.getTimestampfield());
} finally {
sqlSession.close();
}
}