Grails : TIPS
TIPS
Criteria gotcha
Tricks, tricks : http://mrhaki.blogspot.com/2010/05/grails-goodness-execute-code-for.html
Play with Hibernate Criteria: http://www.zorched.net/2009/09/02/drying-grails-criteria-queries/
Join criteria
def c = Domain.createCriteria() def q0 = { eq 'name', 'peter' } def q1 = { eq 'approved', true } def q2 = { le 'time', new Date() - 7 } Closure join(Object[] queries) { return { for(q in queries) { q.delegate = delegate q() } } } c.list( join(q0, q1, q2) )