@Test
public void testFieldsOnlyInsert() {
FieldsonlyDAO dao = getFieldsonlyDAO();
try {
Fieldsonly record = new Fieldsonly();
record.setDoublefield(11.22);
record.setFloatfield(33.44);
record.setIntegerfield(5);
dao.insert(record);
FieldsonlyExample example = new FieldsonlyExample();
example.createCriteria().andIntegerfieldEqualTo(5);
List<Fieldsonly> answer = dao.selectByExample(example);
assertEquals(1, answer.size());
Fieldsonly returnedRecord = answer.get(0);
assertEquals(record.getIntegerfield(), returnedRecord
.getIntegerfield());
assertEquals(record.getDoublefield(), returnedRecord
.getDoublefield());
assertEquals(record.getFloatfield(), returnedRecord.getFloatfield());
} catch (SQLException e) {
fail(e.getMessage());
}
}