Hiberante 搜索和 IndexedEmbedded 集合
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.