如何将许多实体瞄准有关实体的关系

发布于 2025-02-13 13:59:19 字数 115 浏览 3 评论 0原文

亲爱的@ObjectBox在使用Putmany方法时,我如何将一个实体作为一个关系,就像将一个实体针对许多实体一样,然后将它们放置在使用Putmany时 #ObjectBox #flutter #flutterdev

Dear @objectbox how can I target one entity as a relation while using the putMany method in flutter...something like targeting one entity to many entities and put them once using the putMany
#objectbox #flutter #flutterdev

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

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

发布评论

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

评论(1

﹂绝世的画 2025-02-20 13:59:19

如果要通过多个源对象来定位一个实体,请使用toOne类来建模您的源实体。然后,您可以使用“ settarget()”为每个来源设置关系。

文档的这一部分有一个很好的示例: https://docs.objects.object.io/relasiations #to-One-Ressations

最后,您可以使用此格式将源对象 *:

store.box< source_entity >().putMany([ source_entitiy_1, source_entity_2]);  

*用自己的实体。

您可以在此处找到有关关系的详细信息: https://docs.objectbox.io/relalations

putmany是在此处描述: https://pub.dev/documentation/objectbox/latest/objectbox/box-class.html#:~: text=putputmany

快乐编码!

If you want to target one entity by multiple source objects, use the ToOne class to model your source entities. Then you can set the relation using ‘setTarget()’, individually for each of your sources.

This section of the docs has good examples: https://docs.objectbox.io/relations#to-one-relations

Finally you can put the source objects using this format*:

store.box< source_entity >().putMany([ source_entitiy_1, source_entity_2]);  

*replace source_entity with your own entities.

You can find detailed information about relations here: https://docs.objectbox.io/relations

putMany is described here: https://pub.dev/documentation/objectbox/latest/objectbox/Box-class.html#:~:text=putMany

Happy Coding!

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