大神不对呀,fetchLinks之后 ,deleteWith还是不起作用呀
fetchLinks 后 obj 里面有@Many 的对象,
但是deleteWith 源码里面
public int deleteWith(Object obj, final String regex) {
if (null == obj)
return 0;
final int[] re = new int[1];
Lang.each(obj, false, new Each<Object>() {
public void invoke(int index, Object ele, int length) throws ExitLoop, ContinueLoop,
LoopException {
EntityOperator opt = _optBy(ele);
if (null == opt)
return;
opt.entity.visitMany(ele, regex, doDelete(opt));
opt.entity.visitManyMany(ele, regex, doClearRelationByLinkedField(opt));
opt.entity.visitManyMany(ele, regex, doDelete(opt));
opt.addDeleteSelfOnly();
opt.entity.visitOne(ele, regex, doDelete(opt));
re[0] += opt.exec().getUpdateCount();
}
});
return re[0];
走到re[0] += opt.exec().getUpdateCount(); 时候,看到ele对象 里面 @Many的对象依然为空