1、首先要构建BOTRelationInfo对象,关键要通过BOTRelationInfo的方法getRelationEntries()获取分录集合BOTRelationEntryCollection;
如:BOTRelationInfo relaInfo = new BOTRelationInfo();
BOTRelationEntryCollection relaEryCol=relaInfo.getRelationEntries();
2、再根据BOTRelationEntryCollection分录集合的方法add方法,把构建好的分录对象BOTRelationEntryInfo添加进去;
如:BOTRelationEntryInfo relaEtyInfo = new BOTRelationEntryInfo();
relaEtyInfo.setRelation(relaInfo)
relaEryCol.add(relaEtyInfo);
3、最后通过BOTRelationFactory.getLocalInstance(ctx).addnew(BOTRelationInfo),实现整体保存。
如: BOTRelationFactory.getLocalInstance(ctx).addnew(relaInfo);
整体代码结构如下:
BOTRelationInfo relaInfo = new BOTRelationInfo();
BOTRelationEntryCollection relaEryCol=relaInfo.getRelationEntries();
BOTRelationEntryInfo relaEtyInfo = new BOTRelationEntryInfo();
relaEtyInfo.setRelation(relaInfo)
relaEryCol.add(relaEtyInfo);
BOTRelationFactory.getLocalInstance(ctx).addnew(relaInfo);
推荐阅读