@Override
    public Class<?> validate(Class<?> parent, String property, Class<?> propertyType) {
        try {
            ManagedType managedType = metamodel.managedType(parent);
            Attribute attribute = managedType.getAttribute(property);
            if (attribute instanceof PluralAttribute) {
                return ((PluralAttribute) attribute).getElementType().getJavaType();
            } else {
                return PrimitiveUtils.wrap(attribute.getJavaType());
            }
        } catch (IllegalArgumentException e) {
            return null;
        }
    }
JPAPathBuilderValidator implements PathBuilderValidator using a JPA Metamodel instance
querydsl-jpa/src/main/java/com/querydsl/jpa/support/JPAPathBuilderValidator.java