maanantai 9. elokuuta 2010

Delete records with Hibernate Criteria Builder

A neat way of deleting records with createCriteria and Groovy:
def c = Agency.createCriteria().list {
eq("agency", "XXX")
}*.delete()
Source: http://stackoverflow.com/questions/2232621/how-do-you-bulk-delete-records-in-grails-gorm