private static boolean isEntityPathAndNeedsWrapping(Expression<?> expr) {
        if ((expr instanceof Path && expr.getType().isAnnotationPresent(Entity.class)) ||
            (expr instanceof EntityPath && !RelationalPath.class.isInstance(expr))) {
            Path<?> path = (Path<?>) expr;
            if (path.getMetadata().getParent() == null) {
                return true;
            }
        }
        return false;
    }
{@code Conversions} provides module specific projection conversion functionality

@author tiwe
querydsl-jpa/src/main/java/com/querydsl/jpa/Conversions.java