需求 : (条件1 and 条件2) or ( 条件3 and 条件4)
xxxExample example = new xxxExample();
xxxExample.Criteria c1 = example.createCriteria();
c1.andOne(one).andTwo(two);
xxxExample.Criteria c2 = example.createCriteria();
c2.andThree(three).andFour(four);
example.or(c2);
需求 : 条件1 and (条件2 or 条件3)
- 思路 : 分拆 : A and ( B or C ) ==> ( A and B ) or ( A and C )
xxxExample example = new xxxExample();
xxxExample.Criteria c1 = example.createCriteria();
c1.andOne(one).andTwo(two);
xxxExample.Criteria c2 = example.createCriteria();
c2.andOne(one).andThree(three);
example.or(c2);