spring-data-relational
spring-data-relational copied to clipboard
Should NOT_IN judgment be added to QueryMapper's convertValue function implementation?
The current implementation is like this @Nullable private Object convertValue(Comparator comparator, @Nullable Object value, TypeInformation<?> typeHint) {
if (Comparator.IN.equals(comparator) && value instanceof Collection<?> collection && !collection.isEmpty()) {
Collection<Object> mapped = new ArrayList<>(collection.size());
for (Object o : collection) {
mapped.add(convertValue(o, typeHint));
}
return mapped;
}
return convertValue(value, typeHint);
}
My scenario is like this. I implemented the conversion from Collection to String myself. If NOT_IN is not determined before, the subsequent conversion function first determines whether conversion is possible, resulting in the wrong type of conversion.
It should be added. Do you want to submit a pull request?
It should be added. Do you want to submit a pull request?
ok, i'll submit.