Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在写一个 ORM。我很好奇朋友关系通常是如何建模的。他们是在链接表中重复关系,每个用户都是他的朋友关系的所有者,还是引入了相互拥有的关系,其中 orm 查找关系链接,其中关系所有者的 id 可以在关系的子字段中链接表?
我从来没有见过 ORM 做你的“共同拥有的关系”,因为它只适用于只读场景,但 ORM 通常用于读写。我会像这样建模它们