use of mbg.test.ib2j5.generated.flat.model.Fieldsblobs in project generator by mybatis.
the class FlatJava5Test method testFieldsBlobsSelectByExampleWithoutBlobs.
@Test
public void testFieldsBlobsSelectByExampleWithoutBlobs() {
SqlSession sqlSession = sqlSessionFactory.openSession();
try {
FieldsblobsMapper mapper = sqlSession.getMapper(FieldsblobsMapper.class);
Fieldsblobs record = new Fieldsblobs();
record.setFirstname("Jeff");
record.setLastname("Smith");
record.setBlob1(generateRandomBlob());
record.setBlob2(generateRandomBlob());
mapper.insert(record);
record = new Fieldsblobs();
record.setFirstname("Scott");
record.setLastname("Jones");
record.setBlob1(generateRandomBlob());
record.setBlob2(generateRandomBlob());
mapper.insert(record);
FieldsblobsExample example = new FieldsblobsExample();
example.createCriteria().andFirstnameLike("S%");
List<Fieldsblobs> answer = mapper.selectByExample(example);
assertEquals(1, answer.size());
Fieldsblobs newRecord = answer.get(0);
assertEquals(record.getFirstname(), newRecord.getFirstname());
assertEquals(record.getLastname(), newRecord.getLastname());
assertNull(newRecord.getBlob1());
assertNull(newRecord.getBlob2());
} finally {
sqlSession.close();
}
}
Aggregations