本文整理匯總了Java中com.querydsl.core.types.dsl.BooleanOperation類的典型用法代碼示例。如果您正苦於以下問題:Java BooleanOperation類的具體用法?Java BooleanOperation怎麽用?Java BooleanOperation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
BooleanOperation類屬於com.querydsl.core.types.dsl包,在下文中一共展示了BooleanOperation類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: collectionNotEmpty
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void collectionNotEmpty() {
Map<String, Path> pathHashMap = ImmutableMap.<String, Path>builder()
.put("employee.nameCollection", employee.nameCollection)
.build();
String rqlFilter = "employee.nameCollection=sizene=0";
Predicate predicate = DEFAULT_FILTER_PARSER.parse(rqlFilter,
withBuilderAndParam(new QuerydslFilterBuilder(), new QuerydslFilterParam()
.setMapping(pathHashMap)));
assertNotNull(predicate);
BooleanOperation sizeExpression = (BooleanOperation) predicate;
assertEquals("!(size(employee.nameCollection) = 0)", sizeExpression.toString());
}
示例2: collectionEmpty
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void collectionEmpty() {
Map<String, Path> pathHashMap = ImmutableMap.<String, Path>builder()
.put("employee.nameCollection", employee.nameCollection)
.build();
String rqlFilter = "employee.nameCollection=size=0";
Predicate predicate = DEFAULT_FILTER_PARSER.parse(rqlFilter,
withBuilderAndParam(new QuerydslFilterBuilder(), new QuerydslFilterParam()
.setMapping(pathHashMap)));
assertNotNull(predicate);
BooleanOperation sizeExpression = (BooleanOperation) predicate;
assertEquals("size(employee.nameCollection) = 0", sizeExpression.toString());
}
示例3: collectionSizeEquals
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void collectionSizeEquals() {
Map<String, Path> pathHashMap = ImmutableMap.<String, Path>builder()
.put("employee.nameCollection", employee.nameCollection)
.build();
String rqlFilter = "employee.nameCollection=size=5";
Predicate predicate = DEFAULT_FILTER_PARSER.parse(rqlFilter,
withBuilderAndParam(new QuerydslFilterBuilder(), new QuerydslFilterParam()
.setMapping(pathHashMap)));
assertNotNull(predicate);
BooleanOperation sizeExpression = (BooleanOperation) predicate;
assertEquals("size(employee.nameCollection) = 5", sizeExpression.toString());
}
示例4: testParse_DateTimeEquals_AM
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void testParse_DateTimeEquals_AM() {
String selector = "startTime";
String argument = "'2014-09-09 10:00:00'";
String rqlFilter = RSQLUtil.build(selector, RSQLOperators.EQUAL, argument);
LOG.debug("RQL Expression : {}", rqlFilter);
FilterParser filterParser = new DefaultFilterParser();
Predicate predicate = filterParser.parse(rqlFilter, withBuilderAndParam(new QuerydslFilterBuilder(), FilterAssertUtil.withFilterParam(LocalDateTime.class, selector)));
assertNotNull(predicate);
assertTrue(predicate instanceof BooleanOperation);
BooleanOperation booleanOperation = (BooleanOperation) predicate;
assertEquals(2, booleanOperation.getArgs().size());
assertEquals(selector, booleanOperation.getArg(0).toString());
assertEquals(PathTestUtil.unquote(argument), formatLocalDateTime(booleanOperation));
assertEquals(Ops.EQ, booleanOperation.getOperator());
}
示例5: testParse_DateTimeEquals_PM
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void testParse_DateTimeEquals_PM() {
String selector = "startTime";
String argument = "'2014-09-09 21:00:00'";
String rqlFilter = RSQLUtil.build(selector, RSQLOperators.EQUAL, argument);
LOG.debug("RQL Expression : {}", rqlFilter);
FilterParser filterParser = new DefaultFilterParser();
Predicate predicate = filterParser.parse(rqlFilter, withBuilderAndParam(new QuerydslFilterBuilder(), FilterAssertUtil.withFilterParam(LocalDateTime.class, selector)));
assertNotNull(predicate);
assertTrue(predicate instanceof BooleanOperation);
BooleanOperation booleanOperation = (BooleanOperation) predicate;
assertEquals(2, booleanOperation.getArgs().size());
assertEquals(selector, booleanOperation.getArg(0).toString());
assertEquals(PathTestUtil.unquote(argument), formatLocalDateTime(booleanOperation));
assertEquals(Ops.EQ, booleanOperation.getOperator());
}
示例6: testParse_DateTimeNotEquals
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void testParse_DateTimeNotEquals() {
String selector = "startTime";
String argument = "'2014-09-09 10:00:00'";
String rqlFilter = RSQLUtil.build(selector, RSQLOperators.NOT_EQUAL, argument);
LOG.debug("RQL Expression : {}", rqlFilter);
FilterParser filterParser = new DefaultFilterParser();
Predicate predicate = filterParser.parse(rqlFilter, withBuilderAndParam(new QuerydslFilterBuilder(), FilterAssertUtil.withFilterParam(LocalDateTime.class, selector)));
assertNotNull(predicate);
assertTrue(predicate instanceof BooleanOperation);
BooleanOperation booleanOperation = (BooleanOperation) predicate;
assertEquals(2, booleanOperation.getArgs().size());
assertEquals(selector, booleanOperation.getArg(0).toString());
assertEquals(PathTestUtil.unquote(argument), formatLocalDateTime(booleanOperation));
assertEquals(Ops.NE, booleanOperation.getOperator());
}
示例7: testParse_DateTimeGreaterThan
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void testParse_DateTimeGreaterThan() {
String selector = "startTime";
String argument = "'2014-09-09 10:00:00'";
String rqlFilter = RSQLUtil.build(selector, RSQLOperators.GREATER_THAN, argument);
LOG.debug("RQL Expression : {}", rqlFilter);
FilterParser filterParser = new DefaultFilterParser();
Predicate predicate = filterParser.parse(rqlFilter, withBuilderAndParam(new QuerydslFilterBuilder(), FilterAssertUtil.withFilterParam(LocalDateTime.class, selector)));
assertNotNull(predicate);
assertTrue(predicate instanceof BooleanOperation);
BooleanOperation booleanOperation = (BooleanOperation) predicate;
assertEquals(2, booleanOperation.getArgs().size());
assertEquals(selector, booleanOperation.getArg(0).toString());
assertEquals(PathTestUtil.unquote(argument), formatLocalDateTime(booleanOperation));
assertEquals(Ops.GT, booleanOperation.getOperator());
}
示例8: testParse_DateTimeGreaterThanOrEquals
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void testParse_DateTimeGreaterThanOrEquals() {
String selector = "startTime";
String argument = "'2014-09-09 10:00:00'";
String rqlFilter = RSQLUtil.build(selector, RSQLOperators.GREATER_THAN_OR_EQUAL, argument);
LOG.debug("RQL Expression : {}", rqlFilter);
FilterParser filterParser = new DefaultFilterParser();
Predicate predicate = filterParser.parse(rqlFilter, withBuilderAndParam(new QuerydslFilterBuilder(), FilterAssertUtil.withFilterParam(LocalDateTime.class, selector)));
assertNotNull(predicate);
assertTrue(predicate instanceof BooleanOperation);
BooleanOperation booleanOperation = (BooleanOperation) predicate;
assertEquals(2, booleanOperation.getArgs().size());
assertEquals(selector, booleanOperation.getArg(0).toString());
assertEquals(PathTestUtil.unquote(argument), formatLocalDateTime(booleanOperation));
assertEquals(Ops.GOE, booleanOperation.getOperator());
}
示例9: testParse_DateTimeLessThan
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void testParse_DateTimeLessThan() {
String selector = "startTime";
String argument = "'2014-09-09 10:00:00'";
String rqlFilter = RSQLUtil.build(selector, RSQLOperators.LESS_THAN, argument);
LOG.debug("RQL Expression : {}", rqlFilter);
FilterParser filterParser = new DefaultFilterParser();
Predicate predicate = filterParser.parse(rqlFilter, withBuilderAndParam(new QuerydslFilterBuilder(), FilterAssertUtil.withFilterParam(LocalDateTime.class, selector)));
assertNotNull(predicate);
assertTrue(predicate instanceof BooleanOperation);
BooleanOperation booleanOperation = (BooleanOperation) predicate;
assertEquals(2, booleanOperation.getArgs().size());
assertEquals(selector, booleanOperation.getArg(0).toString());
assertEquals(PathTestUtil.unquote(argument), formatLocalDateTime(booleanOperation));
assertEquals(Ops.LT, booleanOperation.getOperator());
}
示例10: testParse_DateTimeLessThanOrEquals
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void testParse_DateTimeLessThanOrEquals() {
String selector = "startTime";
String argument = "'2014-09-09 10:00:00'";
String rqlFilter = RSQLUtil.build(selector, RSQLOperators.LESS_THAN_OR_EQUAL, argument);
LOG.debug("RQL Expression : {}", rqlFilter);
FilterParser filterParser = new DefaultFilterParser();
Predicate predicate = filterParser.parse(rqlFilter, withBuilderAndParam(new QuerydslFilterBuilder(), FilterAssertUtil.withFilterParam(LocalDateTime.class, selector)));
assertNotNull(predicate);
assertTrue(predicate instanceof BooleanOperation);
BooleanOperation booleanOperation = (BooleanOperation) predicate;
assertEquals(2, booleanOperation.getArgs().size());
assertEquals(selector, booleanOperation.getArg(0).toString());
assertEquals(PathTestUtil.unquote(argument), formatLocalDateTime(booleanOperation));
assertEquals(Ops.LOE, booleanOperation.getOperator());
}
示例11: testParse_DateTimeIn
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void testParse_DateTimeIn() {
String selector = "startTime";
String argument = "'2014-09-09 10:00:00'";
String argument2 = "'2014-09-09 11:00:00'";
String rqlFilter = RSQLUtil.build(selector, RSQLOperators.IN, argument, argument2);
LOG.debug("RQL Expression : {}", rqlFilter);
FilterParser filterParser = new DefaultFilterParser();
Predicate predicate = filterParser.parse(rqlFilter, withBuilderAndParam(new QuerydslFilterBuilder(), FilterAssertUtil.withFilterParam(LocalDateTime.class, selector)));
assertNotNull(predicate);
assertTrue(predicate instanceof BooleanOperation);
BooleanOperation booleanOperation = (BooleanOperation) predicate;
assertEquals(2, booleanOperation.getArgs().size());
assertEquals(selector, booleanOperation.getArg(0).toString());
assertEquals("[2014-09-09T10:00, 2014-09-09T11:00]", booleanOperation.getArg(1).toString());
assertEquals(Ops.IN, booleanOperation.getOperator());
}
示例12: testParse_DateTimeNotIn
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void testParse_DateTimeNotIn() {
String selector = "startTime";
String argument = "'2014-09-09 10:00:00'";
String argument2 = "'2014-09-09 11:00:00'";
String rqlFilter = RSQLUtil.build(selector, RSQLOperators.NOT_IN, argument, argument2);
LOG.debug("RQL Expression : {}", rqlFilter);
FilterParser filterParser = new DefaultFilterParser();
Predicate predicate = filterParser.parse(rqlFilter, withBuilderAndParam(new QuerydslFilterBuilder(), FilterAssertUtil.withFilterParam(LocalDateTime.class, selector)));
assertNotNull(predicate);
assertTrue(predicate instanceof BooleanOperation);
BooleanOperation booleanOperation = (BooleanOperation) predicate;
assertEquals(2, booleanOperation.getArgs().size());
assertEquals(selector, booleanOperation.getArg(0).toString());
assertEquals("[2014-09-09T10:00, 2014-09-09T11:00]", booleanOperation.getArg(1).toString());
assertEquals(Ops.NOT_IN, booleanOperation.getOperator());
}
示例13: listNotEmpty
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void listNotEmpty() {
Map<String, Path> pathHashMap = ImmutableMap.<String, Path>builder()
.put("employee.names", QEmployee.employee.names)
.build();
String rqlFilter = "employee.names=sizene=0";
Predicate predicate = DEFAULT_FILTER_PARSER.parse(rqlFilter,
withBuilderAndParam(new QuerydslFilterBuilder(), new QuerydslFilterParam()
.setMapping(pathHashMap)));
assertNotNull(predicate);
BooleanOperation sizeExpression = (BooleanOperation) predicate;
assertEquals("!(size(employee.names) = 0)", sizeExpression.toString());
}
示例14: listEmpty
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void listEmpty() {
Map<String, Path> pathHashMap = ImmutableMap.<String, Path>builder()
.put("employee.names", QEmployee.employee.names)
.build();
String rqlFilter = "employee.names=size=0";
Predicate predicate = DEFAULT_FILTER_PARSER.parse(rqlFilter,
withBuilderAndParam(new QuerydslFilterBuilder(), new QuerydslFilterParam()
.setMapping(pathHashMap)));
assertNotNull(predicate);
BooleanOperation sizeExpression = (BooleanOperation) predicate;
assertEquals("size(employee.names) = 0", sizeExpression.toString());
}
示例15: listSizeEquals
import com.querydsl.core.types.dsl.BooleanOperation; //導入依賴的package包/類
@Test
public void listSizeEquals() {
Map<String, Path> pathHashMap = ImmutableMap.<String, Path>builder()
.put("employee.names", QEmployee.employee.names)
.build();
String rqlFilter = "employee.names=size=5";
Predicate predicate = DEFAULT_FILTER_PARSER.parse(rqlFilter,
withBuilderAndParam(new QuerydslFilterBuilder(), new QuerydslFilterParam()
.setMapping(pathHashMap)));
assertNotNull(predicate);
BooleanOperation sizeExpression = (BooleanOperation) predicate;
assertEquals("size(employee.names) = 5", sizeExpression.toString());
}