根据 EObject 的内容将其保存在不同的资源中

发布于 2024-12-05 09:56:11 字数 264 浏览 1 评论 0原文

我正在使用 EMF 模型,它由多个命令组成。

每个命令都有一个名为 subscribed 的布尔属性,由我的应用程序处理。根据此属性的值,我想将命令保存在文件“已提交”或文件“toSubmit”中。我怎样才能做到这一点?

由于要提交的元素可以引用已提交的元素,因此我打算将它们放在同一资源集中的两个资源中......这足以交叉引用吗?

此外,我还想要一个“完整”文件,其中包含要提交的元素和已提交的元素......

I'm working with an EMF model, which is composed of several Commands.

Each command has a boolean attribute named submitted which is handled by my application. According to the value of this attribute, I want to save the Command in file "submitted" or in file "toSubmit". How can I do that?

Since elements to be submitted can refer to submitted elements, I was planning to put them in two resources of the same resourceSet... is this enough for cross-references?

Additionally, I would also like to have a "complete" file, which comprehend both element to submit and those already submitted...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

丿*梦醉红颜 2024-12-12 09:56:11

还有一件事:为了交叉引用,除了保存到同一资源集中之外,引用的元素还必须保存在资源中。

换句话说,您必须根据依赖关系对资源的保存进行排序:首先必须保存资源(不引用其他资源),然后保存引用者。

There is one more thing: in order to cross-reference, in addition to being saved into the same resourceset the referenced elements have to be saved in a resource already.

In other words, you have to order the saving of the resources wrt the dependencies: first the resource has to be saved, that is not refering to the other, and then the referrer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文