if ((i + 1) < cqe.getTerm().getValues().size())
sqlQuery += " OR ";
}
sqlQuery += ")";
}else if (queryExpression instanceof NotQueryExpression) {
NotQueryExpression nqe = (NotQueryExpression) queryExpression;
sqlQuery = "SELECT DISTINCT transaction_id FROM transaction_terms WHERE " + bucketNameFilter + " NOT (" + this.getSqlQuery(nqe.getQueryExpression()) + ")";
}else if (queryExpression instanceof StdQueryExpression) {
sqlQuery = "SELECT DISTINCT transaction_id FROM transaction_terms " + bucketNameFilter;
}else {
throw new QueryServiceException("Invalid QueryExpression '" + queryExpression.getClass().getCanonicalName() + "'");
}