Hiberante 搜索和 IndexedEmbedded 集合

发布于 2024-12-04 19:01:28 字数 257 浏览 7 评论 0原文

Bean Parent 有一个应该被索引的 Child 集合。为此,我必须定义属性 childs (@OneToMany) 并将其标记为 @IndexedEmbedded。问题是除了索引之外,我在任何其他时间都不需要属性 childs 。所以我不想在 bean 中定义它,因为它使结构变得更加复杂

我怎样才能更好地解决我的问题?

Bean Parent has a collection of Child that should be indexted. To do so I have to define property childs (@OneToMany) and mark it as @IndexedEmbedded. The problem is I do not need property childs any other time except indexing. So I don't want define it at bean because it make structure much more complicated

How can I solve my problem better way?

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

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

发布评论

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

评论(1

梦巷 2024-12-11 19:01:28

https://forum.hibernate.org/viewtopic.php?f=9& ;t=1012658 - 已在 Hibernate Search 论坛上进行了讨论。从建模的角度来看,具有双向关系并使用延迟加载是有意义的。

https://forum.hibernate.org/viewtopic.php?f=9&t=1012658 - Has been discussed already on the Hibernate Search forum. From a modeling point of view it makes sense to have bidirectional relations and use lazy loading.

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