replacing sql queries with grails criteria