use of io.requery.query.element.WhereConditionElement in project requery by requery.
the class WhereGenerator method write.
@Override
public void write(Output output, WhereElement query) {
QueryBuilder qb = output.builder();
ExistsElement<?> whereExists = query.getWhereExistsElement();
if (whereExists != null) {
qb.keyword(WHERE);
if (whereExists.isNotExists()) {
qb.keyword(NOT);
}
qb.keyword(EXISTS);
qb.openParenthesis();
Supplier<?> wrapper = whereExists.getQuery();
output.appendQuery((QueryWrapper) wrapper);
qb.closeParenthesis().space();
} else if (query.getWhereElements() != null && query.getWhereElements().size() > 0) {
qb.keyword(WHERE);
for (WhereConditionElement<?> w : query.getWhereElements()) {
output.appendConditional(w);
}
}
}
Aggregations