Matcher isNullMatcher = isNullOperator.matcher(searchStr); if (isNullMatcher.matches()) { return numberExpression.isNull();
Matcher isNullMatcher = isNullOperator.matcher(searchStr); if (isNullMatcher.matches()) { return numberExpression.isNull();
@Override public List<Worklog> getByIssue(final Issue issue) { checkArgument(issue != null, "Cannot resolve worklogs for null issue."); final BooleanExpression query = issue.getId() != null ? WORKLOG.issue.eq(issue.getId()) : WORKLOG.issue.isNull(); return dbConnectionManager.executeQuery(dc -> dc.newSqlQuery() .from(WORKLOG) .leftJoin(QProjectRole.PROJECT_ROLE) .on(QProjectRole.PROJECT_ROLE.id.eq(WORKLOG.rolelevel)) .where(query) .orderBy(WORKLOG.created.asc()) .list(WORKLOG_PROJECT_ROLE_TUPLE) ).stream() .map(t -> queryDSLWorklogFactory.createWorklog(issue, t)) .collect(Collectors.toList()); }
@Test public void CaseBuilder() { QCat cat2 = new QCat("cat2"); NumberExpression<Integer> casex = new CaseBuilder() .when(cat.weight.isNull().and(cat.weight.isNull())).then(0) .when(cat.weight.isNull()).then(cat2.weight) .when(cat2.weight.isNull()).then(cat.weight) .otherwise(cat.weight.add(cat2.weight)); query().from(cat, cat2).orderBy(casex.asc()).list(cat.id, cat2.id); query().from(cat, cat2).orderBy(casex.desc()).list(cat.id, cat2.id); }
@Test public void Where_5() throws Exception { query().from(an).where( an.bodyWeight.gt(10), an.bodyWeight.lt(100).or(an.bodyWeight.isNull())) .parse(); }
.where(it.avatar.isNull() .and(it.iconurl.eq(oldIconUrl))) .set(it.avatar, new SQLSubQuery()
@Test public void GroupingOperationsAndNullChecks() { // in, not in, between, is null, is not null, is empty, is not empty, // member of and not member of // in, // not in, // between, // is null, // is not null, // is empty, // is not empty, // member of // not member of kitten.in(cat.kittens); kitten.in(cat.kittens).not(); kitten.bodyWeight.between(10, 20); kitten.bodyWeight.isNull(); kitten.bodyWeight.isNotNull(); cat.kittens.isEmpty(); cat.kittens.isNotEmpty(); }