fix for GRAILS-9328 + refactored HibernateCriterionAdapter + test case