I want to write a custom converter in Spring Data JDBC like this -
@ReadingConverter
public class IntegerToStringConverter implements Converter<Integer, String> {
@Override
public String convert(Integer source) {
return source != null && source == 0 ? "ABC" : "XYZ";
}
}
I want this conversion to be applied only on a few fields of the response as in all Integers should not be converted to String using the above reading converter rule? Spring Data JDBC Documentation doesn't mention any restricted conversion example