HHH-9294 Reduce throw of NumberFormatException in BaseQueryImpl
HHH-9294 move the number checking utility to a separate private utility