return true;
}
@Override
public Object convertToPropertyType(String entityType, List<String> propertyPath, String value) {
FieldDescriptor field = getField(entityType, propertyPath);
//todo [anistor] this is just for remote query because booleans and enums are handled as integers for historical reasons.
if (field.getJavaType() == JavaType.BOOLEAN) {
try {
return Integer.parseInt(value) != 0;
} catch (NumberFormatException e) {
return super.convertToPropertyType(entityType, propertyPath, value);
}
} else if (field.getJavaType() == JavaType.ENUM) {
EnumDescriptor enumType = field.getEnumDescriptor();
EnumValueDescriptor enumValue;
try {
enumValue = enumType.findValueByNumber(Integer.parseInt(value));
} catch (NumberFormatException e) {
enumValue = enumType.findValueByName(value);