如何将许多实体瞄准有关实体的关系
亲爱的@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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果要通过多个源对象来定位一个实体,请使用
toOne
类来建模您的源实体。然后,您可以使用“ settarget()”为每个来源设置关系。文档的这一部分有一个很好的示例: https://docs.objects.object.io/relasiations #to-One-Ressations
最后,您可以使用此格式将源对象 *:
*用自己的实体。
您可以在此处找到有关关系的详细信息: 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*:
*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!