@SuppressWarnings("unchecked")
    private void addCondition(Context context, int i, Path<?> path, boolean where) {
        paths.add(path);
        EntityPath<?> alias = context.replacements.get(i);
        leftJoin((Expression) path.getMetadata().getParent(), context.replacements.get(i));
        Expression index = ExpressionUtils.operation(Integer.class, JPQLOps.INDEX, alias);
        Object element = path.getMetadata().getElement();
        if (!(element instanceof Expression)) {
            element = ConstantImpl.create(element);
        }
        Predicate condition = ExpressionUtils.eq(index, (Expression) element);
        if (where) {
            super.where(condition);
        } else {
            super.having(condition);
        }
    }
{@code JPAQueryMixin} extends {@link QueryMixin} to support JPQL join construction

@author tiwe

@param <T>
querydsl-jpa/src/main/java/com/querydsl/jpa/JPAQueryMixin.java