//清除子表数据
public SalesSet removeSalesSetDistributor(SalesSet salesSet ){
List<SalesSetDistributor> salesSetDistributorList = salesSet.getSalesSetDistributors();
deleteAll(salesSetDistributorList);
salesSetDistributorList.clear();
save(salesSet); return salesSet;
}

hibernate有关联关系删除子表时可能会报错,可以用个clear避免错误

05-02 22:26