@Override
    public Void visit(SubQueryExpression<?> expr, QueryMetadata context) {
        QueryMetadata md = expr.getMetadata();
        for (Map.Entry<ParamExpression<?>, Object> entry : md.getParams().entrySet()) {
            context.setParam((ParamExpression) entry.getKey(), entry.getValue());
        }
        visit(md.getGroupBy(), context);
        visit(md.getHaving(), context);
        for (JoinExpression join : md.getJoins()) {
            visit(join.getTarget(), context);
            visit(join.getCondition(), context);
        }
        visit(md.getProjection(), context);
        visit(md.getWhere(), context);

        return null;
    }
Copies {@code ParameterExpression} bindings from subexpressions to {@link QueryMetadata} in the context

@author tiwe
querydsl-core/src/main/java/com/querydsl/core/types/ParamsVisitor.java