mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-27 21:01:15 +08:00
This commit is contained in:
parent
62618162b5
commit
3300cd2b60
@ -31,8 +31,8 @@ public class CascadingBoolean extends EBoolean{
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
public CascadingBoolean andAny(EBoolean... args) {
|
||||
|
||||
public CascadingBoolean andAnyOf(EBoolean... args) {
|
||||
if (args.length > 0){
|
||||
EBoolean any = args[0];
|
||||
for (int i = 1; i < args.length; i++){
|
||||
@ -57,7 +57,7 @@ public class CascadingBoolean extends EBoolean{
|
||||
return this;
|
||||
}
|
||||
|
||||
public CascadingBoolean orAll(EBoolean... args) {
|
||||
public CascadingBoolean orAllOf(EBoolean... args) {
|
||||
if (args.length > 0){
|
||||
EBoolean all = args[0];
|
||||
for (int i = 1; i < args.length; i++){
|
||||
|
||||
@ -7,7 +7,6 @@ package com.mysema.query;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.alias.Alias;
|
||||
import com.mysema.query.types.expr.EBoolean;
|
||||
|
||||
|
||||
@ -19,10 +18,20 @@ import com.mysema.query.types.expr.EBoolean;
|
||||
*/
|
||||
public class CascadingBooleanTest {
|
||||
|
||||
private EBoolean first = EBoolean.TRUE;
|
||||
|
||||
private EBoolean second = EBoolean.FALSE;
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
EBoolean etrue = Alias.$(true);
|
||||
EBoolean efalse = Alias.$(false);
|
||||
new CascadingBoolean().and(etrue).or(efalse);
|
||||
new CascadingBoolean().and(first).or(second);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void advanced(){
|
||||
CascadingBoolean builder = new CascadingBoolean();
|
||||
builder.andAnyOf(first, second, first);
|
||||
builder.orAllOf(first, second, first);
|
||||
System.out.println(builder);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user