一对多关系上的一般 ORM 模型矛盾

General ORM model contradiction on a one to many relation

我在将 OOM 映射到 ROM 时遇到了一个非常大的问题。 请查看以下规则:

这是一个简单的一对多关系。

ROM 如下所示:

category (cId, ...)
item     (iId, ..., cId) cId reference cId from category

OOM 正好相反,看起来像(伪代码):

class category
    // the category instance holds all items
    Item[] items;

(在 OOM 中我们不能确定一个特定的项目是否只包含在一个类别中。)

现在我的问题是:如何映射这个矛盾?

非常感谢!

我问这个问题有点快。

我在这里代表的问题是 OR 映射器必须解决的将军之一。 每个 OR 映射器都应该处理这个问题,这样程序员就不用担心了。