delete
目的 Purpose
Deletes a persistent instance.使用例 Examples
def book = Book.get(1) book.delete()
詳細 Description
The delete
method informs the persistence context that a persistent instance should be deleted. Equivalent to the Hibernate delete method.
Calling delete
on a transient instance will result in an error
パラメータ: Parameters:
flush
- If set totrue
the persistent context will be flushed resulting in the instance being deleted immediately. For example:
def book = Book.get(1)
book.delete(flush: true)