Skip to content

Should NOT_IN judgment be added to QueryMapper's convertValue function implementation? #1744

Closed
@yande2011

Description

@yande2011

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions