HHH-9294 Reduce throw of NumberFormatException in BaseQueryImpl