需求 : (条件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);
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!