@Override
public List<?> translateCommand(Command command, ExecutionContext context) {
if (!(command instanceof SetQuery)) {
return null;
}
SetQuery queryCommand = (SetQuery)command;
if (queryCommand.getLimit() == null) {
return null;
}
Limit limit = queryCommand.getLimit();
OrderBy orderBy = queryCommand.getOrderBy();
queryCommand.setLimit(null);
queryCommand.setOrderBy(null);
List<Object> parts = new ArrayList<Object>(6);
parts.add("SELECT "); //$NON-NLS-1$
parts.addAll(translateLimit(limit, context));
parts.add(" * FROM ("); //$NON-NLS-1$
parts.add(queryCommand);