fix for GRAILS-10879 - DetachedCriteria with hasMany association results in "where 1=1"