use of mbg.test.mb3.generated.mixed.flat.model.PkonlyExample in project generator by mybatis.
the class FlatJava5Test method testPKOnlySelectByExample.
@Test
public void testPKOnlySelectByExample() {
SqlSession sqlSession = sqlSessionFactory.openSession();
try {
PkonlyMapper mapper = sqlSession.getMapper(PkonlyMapper.class);
Pkonly key = new Pkonly();
key.setId(1);
key.setSeqNum(3);
mapper.insert(key);
key = new Pkonly();
key.setId(5);
key.setSeqNum(6);
mapper.insert(key);
key = new Pkonly();
key.setId(7);
key.setSeqNum(8);
mapper.insert(key);
PkonlyExample example = new PkonlyExample();
example.createCriteria().andIdGreaterThan(4);
List<Pkonly> answer = mapper.selectByExample(example);
assertEquals(2, answer.size());
} finally {
sqlSession.close();
}
}
Aggregations