if (!query.isEmptyFilter()) {
StringBuffer expressionClause = new StringBuffer();
if (!query.getFilters().isEmpty()) {
for (String field : query.getFilters().keySet()) {
SQLFilter filter = query.getFilters().get(field);
if (expressionClause.length() > 0) {
expressionClause.append(" AND ");
}
Object value = filter.getValue() instanceof SQLQuery ?
String.format("(%s)", provider.buildSelectSQL((SQLQuery) filter.getValue())) : "?";
expressionClause.append(filter.getOperation().getSQL(field, value));
}
}
if (!query.getStringFilters().isEmpty()) {
for (SQLStringFilter stringFilter : query.getStringFilters()) {
if (expressionClause.length() > 0) {