您不能在 A 和 B 之间创建直接的主动关系,因为那样会引入歧义
You can't create a direct active relationship between A and B because that would introduce ambiguity
- 我想激活 Analyzers 和 Entries
之间的关系
- 一个实验室有分析仪 (1-*)
- 一个实验室有条目 (1-*)
- 分析器可能包含条目(条目中的IdAnalyzer可以为空)
- 所以在 Lab 中可能有 Entries 但没有引用任何 Analyzer
- 我明白问题是 Analyzers 和 Entries 都指向 Labs
- 我可以看出冗余来自数据库设计,目前它被认为是设置这些关系的快速简便的方法
你能解释一下这个歧义吗?
I understand the problem is that both tables Analyzers and Entries are pointing to Labs
这个解释不太正确。
产生歧义是因为 Labs
有两条不同的路径来过滤 Entries
。
它已经直接通过
过滤
Labs[Id] 1-->* Entries[IdLab]
如果有问题的关系被激活,那么也间接通过
Labs[Id] 1-->* Analyzers[IdLab] 1-->* Entries[IdLab]
我推荐 this article for more insight into ambiguous relationships (even though it's largely about bidirectional relationships). This article 也值得一读。
- 我想激活 Analyzers 和 Entries 之间的关系
- 一个实验室有分析仪 (1-*)
- 一个实验室有条目 (1-*)
- 分析器可能包含条目(条目中的IdAnalyzer可以为空)
- 所以在 Lab 中可能有 Entries 但没有引用任何 Analyzer
- 我明白问题是 Analyzers 和 Entries 都指向 Labs
- 我可以看出冗余来自数据库设计,目前它被认为是设置这些关系的快速简便的方法
你能解释一下这个歧义吗?
I understand the problem is that both tables Analyzers and Entries are pointing to Labs
这个解释不太正确。
产生歧义是因为 Labs
有两条不同的路径来过滤 Entries
。
它已经直接通过
过滤Labs[Id] 1-->* Entries[IdLab]
如果有问题的关系被激活,那么也间接通过
Labs[Id] 1-->* Analyzers[IdLab] 1-->* Entries[IdLab]
我推荐 this article for more insight into ambiguous relationships (even though it's largely about bidirectional relationships). This article 也值得一读。