@SuppressWarnings("unchecked")
    static <T> Class<T> getElementTypeOrType(Path<T> path) {
        if (path instanceof CollectionExpression) {
            return ((CollectionExpression) path).getParameter(0);
        } else {
            return (Class<T>) path.getType();
        }
    }
{@code JPAQueryMixin} extends {@link QueryMixin} to support JPQL join construction

@author tiwe

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