parent.getChildren().clear(); //getChildren()返回了一个受管的List parentRepository.save(parent);
转载于:https://www.cnblogs.com/java-arthur/p/11149197.html
本文介绍了一种在Java中操作对象树的方法,具体为使用parent.getChildren().clear()来清除父对象的所有子对象,并通过parentRepository.save(parent)保存更改。这种方法常用于数据管理和对象更新场景。
parent.getChildren().clear(); //getChildren()返回了一个受管的List parentRepository.save(parent);
转载于:https://www.cnblogs.com/java-arthur/p/11149197.html
1161

被折叠的 条评论
为什么被折叠?
