return evaluateCriteria(criteria);
}
private void addImplicitLimit(SubqueryContainer<QueryCommand> container, int rowLimit) {
if (container.getCommand().getLimit() != null) {
Limit lim = container.getCommand().getLimit();
if (lim.getRowLimit() instanceof Constant) {
Constant c = (Constant)lim.getRowLimit();
if (!c.isMultiValued() && Integer.valueOf(rowLimit).compareTo((Integer) c.getValue()) <= 0) {
lim.setRowLimit(new Constant(rowLimit));
if (lim.getRowLimit() == null) {
lim.setImplicit(true);
container.getCommand().setOrderBy(null);
}
}
}
return;
}
boolean addLimit = true;
if (container.getCommand() instanceof Query) {
Query query = (Query)container.getCommand();
addLimit = !(query.hasAggregates() && query.getGroupBy() == null);
}
if (addLimit) {
Limit lim = new Limit(null, new Constant(rowLimit));
lim.setImplicit(true);
container.getCommand().setLimit(lim);
}
}