Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Building a histogram from a Grails criteria search.
Employee.withCriteria {
projections {
groupProperty "gender"
rowCount()
}
}.inject([:]) { histo, row ->
histo[row[0]] = row[1]
histo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment