docs: public Object convertToPropertyType(TypeMetadata entityType, String[] propertyPath, String value) {
        final Class<?> propertyType = getPrimitivePropertyType(entityType, propertyPath);
        if (propertyType == null) {
           // not a primitive, then it is an embedded entity, need to signal an invalid query
           throw log.getPredicatesOnCompleteEmbeddedEntitiesNotAllowedException(StringHelper.join(propertyPath));
        }
  
        if (Date.class.isAssignableFrom(propertyType)) {
           try {
              return DateHelper.getJpaDateFormat().parse(value);
           } catch (ParseException e) {
              throw log.getInvalidDateLiteralException(value);
           }
        }
  
        if (Instant.class.isAssignableFrom(propertyType)) {
           return Instant.parse(value);
        }
  
        if (Enum.class.isAssignableFrom(propertyType)) {
           try {
              return Enum.valueOf((Class<Enum>) propertyType, value);
           } catch (IllegalArgumentException e) {
              throw log.getInvalidEnumLiteralException(value, propertyType.getName());
           }
        }
  
        if (propertyType == String.class) {
           return value;
        }
  
        if (propertyType == Character.class || propertyType == char.class) {
           return value.charAt(0);
        }
  
        try {
           if (propertyType == Double.class || propertyType == double.class) {
              return Double.valueOf(value);
           }
           if (propertyType == Float.class || propertyType == float.class) {
              return Float.valueOf(value);
           }
           if (propertyType == Long.class || propertyType == long.class) {
              return Long.valueOf(value);
           }
           if (propertyType == Integer.class || propertyType == int.class) {
              return Integer.valueOf(value);
           }
           if (propertyType == Short.class || propertyType == short.class) {
              return Short.valueOf(value);
           }
           if (propertyType == Byte.class || propertyType == byte.class) {
              return Byte.valueOf(value);
           }
        } catch (NumberFormatException ex) {
           throw log.getInvalidNumericLiteralException(value);
        }
  
        if (propertyType == Boolean.class || propertyType == boolean.class) {
           if ("true".equalsIgnoreCase(value)) {
              return true;
           } else if ("false".equalsIgnoreCase(value)) {
              return false;
           } else {
              throw log.getInvalidBooleanLiteralException(value);
           }
        }
  
        return value;
     }