Predicates - griffio/griffio.github.io GitHub Wiki
Predicates
They're the thing which gets us to the thing.
BooleanExpression isBonus = QSalaryDetail.salaryDetail.salaryName.equalsIgnoreCase("Bonus");
BooleanExpression isGreaterThanThreshold = QSalaryDetail.salaryDetail.salary.goe(paydayThreshold);
BooleanExpression predicate = isBonus.and(isGreaterThanThreshold);
Types
com.mysema.query.types.expr
com.mysema.query.types.path
BooleanBuilder isSalaryThresholdRelevant = new BooleanBuilder(
QSalaryDetail.salaryDetail.salaryName.eq(salary.getSalaryName());
if (!other.salaryName().equalsIgnoreCase("other")) {
booleanBuilder.and(QSalaryDetail.salaryDetail.salary.gt(thresholdForPayPeriod));
}
CaseBuilder caseOfSalaryname = new CaseBuilder()
.when(QSalaryDetail.salaryDetail.isSalaryRelevant()
.and(QSalaryDetail.salaryDetail.salary.goe(thresholdForPayPeriod)))
.then(QSalaryDetail.salaryDetail.salaryName)
.otherwise("other");