如何更改有序持久集合中的顺序?
我只需要更改(以前持久化的)有序集合中的项目顺序...
我尝试简单地将重新排列的集合传递给设置器:提交事务后,集合消失了。
然后我尝试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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
数据的顺序在索引中设置。不幸的是,当前不存在删除或重置索引的功能(如何删除 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.