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.
假设我们有两个表 Posts 和 Categories,它们具有多对一关系,一个类别对多个帖子。在类定义中定义它的最佳方法是什么?
因为您希望能够做一些事情,比如myCategory->Posts如果您有一个类别,而且myPost->categories,您希望定义这两种关系。
myCategory->Posts
myPost->categories