0
내 도메인 클래스 내부의 데이터베이스에서 작업을 수행 할 때 flush : true로 설정해야하는지 궁금합니다. 예 :도메인 클래스 업데이트 및 세션 플러시?
class TreeNode {
TreeNode removeFromChildren(TreeNode child) {
TreeNodeChild.findByNodeAndChild(this, child).delete(flush: true)
this
}
...
}
또는 다음 올바른 표기법은 무엇입니까?
class TreeNode {
TreeNode removeFromChildren(TreeNode child) {
TreeNodeChild.findByNodeAndChild(this, child).delete()
this
}
...
}
질문 : 세션을 플러시해야합니까?