如何更改有序持久集合中的顺序?

发布于 2024-09-02 14:39:10 字数 270 浏览 3 评论 0原文

我只需要更改(以前持久化的)有序集合中的项目顺序...

我尝试简单地将重新排列的集合传递给设置器:提交事务后,集合消失了。
然后我尝试clear()现有集合,然后addAll():clear()使持久管理器将所有元素标记为已删除。 (但显然我希望能够在同一事务中使用集合项。)

(该集合不在默认提取组中,因此我也尝试了上述操作,并将指定的提取组添加到提取计划中。否运气。)

这一定是最愚蠢的问题,但我已经没有想法了,我已经被困在这里两天了。我发誓我用谷歌搜索过。 :(

I just need to change order of items in a (previously persisted) ordered collection...

I tried simply passing the re-arranged collection to a setter: after committing a transaction the collection is gone.
Then I tried to clear() the existing collection and addAll() afterwards: clear() makes persistent manager to mark all the elements as deleted. (But obviously I would like to be able to work with the collection items in the very transaction.)

(The collection is not in a default fetch group, so I tried the above also with the named fetch group added into the fetch plan. No luck.)

This must be the most stupid question, but I ran out of ideas and I'm stuck here two days already. I swear I googled. :(

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

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

发布评论

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

评论(1

冷了相思 2024-09-09 14:39:10

数据的顺序在索引中设置。不幸的是,当前不存在删除或重置索引的功能(如何删除 Google App Engine (Java) 中的索引?

不过,可以动态更改索引。 2010/03/dynamic-indexes-with-google-app-engine.html" rel="nofollow noreferrer">http://rahulshackyworld.blogspot.com/2010/03/dynamic-indexes-with-google-app-engine .html。

The order of the data is set in an index. Unfortunately, the functionality to delete or reset the index is not currently there (How-to delete indexes in Google App Engine (Java)?.

It may be possible to dynamically change the index, however. Take a look at http://rahulswackyworld.blogspot.com/2010/03/dynamic-indexes-with-google-app-engine.html.

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