} else if(criteria instanceof HasCriteria) {
criteria = rewriteCriteria((HasCriteria)criteria);
} else if(criteria instanceof TranslateCriteria) {
criteria = rewriteCriteria((TranslateCriteria)criteria);
} else if (criteria instanceof ExistsCriteria) {
ExistsCriteria exists = (ExistsCriteria)criteria;
if (exists.shouldEvaluate() && processing) {
return getCriteria(evaluator.evaluate(exists, null));
}
rewriteSubqueryContainer((SubqueryContainer)criteria, true);
if (!RelationalNodeUtil.shouldExecute(exists.getCommand(), false, true)) {
return exists.isNegated()?TRUE_CRITERIA:FALSE_CRITERIA;
}
if (exists.getCommand().getProcessorPlan() == null) {
if (exists.getCommand() instanceof Query) {
Query query = (Query)exists.getCommand();
if ((query.getLimit() == null || query.getOrderBy() == null) && query.getSelect().getProjectedSymbols().size() > 1) {
query.getSelect().clearSymbols();
query.getSelect().addSymbol(new ExpressionSymbol("x", new Constant(1))); //$NON-NLS-1$
}
}