def book = Book.get(1) book.delete()
Deletes a persistent instance.
delete method informs the persistence context that a persistent instance should be deleted. Equivalent to the Hibernate delete method.
flush- If set to
truethe persistent context will be flushed resulting in the instance being deleted immediately. For example:
def book = Book.get(1) book.delete(flush: true)