240241242243244245246247248249250
example.createCriteria() .andIdEqualTo(7); int rows = mapper.updateByExample(key, example); assertEquals(1, rows); example.clear(); example.createCriteria() .andIdEqualTo(22) .andSeqNumEqualTo(3); rows = mapper.countByExample(example);
23802381238223832384238523862387238823892390
example = new AwfulTableExample(); example.createCriteria().andEMailLike("fred@%"); int rows = mapper.deleteByExample(example); assertEquals(1, rows); example.clear(); answer = mapper.selectByExample(example); assertEquals(1, answer.size()); } finally { sqlSession.close(); }
31383139314031413142314331443145314631473148
AwfulTableExample example = new AwfulTableExample(); example.createCriteria().andEMailLike("fred@%"); int rows = mapper.countByExample(example); assertEquals(1, rows); example.clear(); rows = mapper.countByExample(example); assertEquals(2, rows); } finally { sqlSession.close(); }
160161162163164165166167168169170
example.setDistinct(true); List<Fieldsonly> answer = mapper.selectByExample(example); assertEquals(1, answer.size()); example.clear(); answer = mapper.selectByExample(example); assertEquals(5, answer.size()); } finally { sqlSession.close(); }
272273274275276277278279280281282
FieldsonlyExample example = new FieldsonlyExample(); example.createCriteria().andIntegerfieldGreaterThan(5); int rows = mapper.countByExample(example); assertEquals(2, rows); example.clear(); rows = mapper.countByExample(example); assertEquals(3, rows); } finally { sqlSession.close(); }
15381539154015411542154315441545154615471548
PkblobsExample example = new PkblobsExample(); example.createCriteria().andIdLessThan(4); int rows = mapper.countByExample(example); assertEquals(1, rows); example.clear(); rows = mapper.countByExample(example); assertEquals(2, rows); } finally { sqlSession.close(); }
12371238123912401241124212431244124512461247
PkfieldsExample example = new PkfieldsExample(); example.createCriteria().andLastnameLike("J%"); int rows = mapper.countByExample(example); assertEquals(1, rows); example.clear(); rows = mapper.countByExample(example); assertEquals(2, rows); } finally { sqlSession.close(); }
10811082108310841085108610871088108910901091
16581659166016611662166316641665166616671668
PkfieldsblobsExample example = new PkfieldsblobsExample(); example.createCriteria().andId1NotEqualTo(3); int rows = mapper.countByExample(example); assertEquals(1, rows); example.clear(); rows = mapper.countByExample(example); assertEquals(2, rows); } finally { sqlSession.close(); }
342343344345346347348349350351352
PkonlyExample example = new PkonlyExample(); example.createCriteria().andIdGreaterThan(4); int rows = mapper.countByExample(example); assertEquals(2, rows); example.clear(); rows = mapper.countByExample(example); assertEquals(3, rows); } finally { sqlSession.close(); }