public void testMyObjectSelectByExampleTimeEquals() {
MyObjectDAO dao = getMyObjectDAO();
try {
MyObject record = new MyObject();
record.setStartDate(new Date());
record.setDecimal100field(new Long(10L));
record.setDecimal155field(new Double(15.12345));
record.setDecimal60field(6);
FirstName fn = new FirstName();
fn.setValue("Jeff");
record.setFirstname(fn);
record.setId1(new Integer(1));
record.setId2(new Integer(2));
record.setLastname("Butler");
MyTime myTime = new MyTime();
myTime.setHours(12);
myTime.setMinutes(34);
myTime.setSeconds(05);
record.setTimefield(myTime);
record.setTimestampfield(new Date());
dao.insertMyObject(record);
MyObjectExample example = new MyObjectExample();
example.createCriteria().andTimefieldEqualTo(myTime);
List results = dao.selectMyObjectByExample(example);
assertEquals(1, results.size());
MyObject returnedRecord = (MyObject) results.get(0);
assertTrue(TestUtilities.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());
} catch (SQLException e) {
fail(e.getMessage());
}
}