GRAILS-9996 - improve static type checking for where queries