作者:枫涵笑 | 来源:互联网 | 2023-09-17 18:08
组合关系:table可以有多个外键,外键只能属于某个table
{"name": "rdbms_table_foreign_key","serviceType": "rdbms","typeVersion": "1.2","relationshipCategory": "COMPOSITION","relationshipLabel": "__rdbms_table.foreign_keys","endDef1": {"type": "rdbms_table","name": "foreign_keys","isContainer": true,"cardinality": "SET","isLegacyAttribute": true},"endDef2": {"type": "rdbms_foreign_key","name": "table","isContainer": false,"cardinality": "SINGLE","isLegacyAttribute": true},"propagateTags": "NONE"
}
关联关系:外键实体引用哪个表的外键;我这个表的外键,被哪个外键实体引用。
{"name": "rdbms_foreign_key_table_references","serviceType": "rdbms","typeVersion": "1.2","relationshipCategory": "ASSOCIATION","relationshipLabel": "__rdbms_foreign_key.references_table","endDef1": {"type": "rdbms_foreign_key","name": "references_table","isContainer": false,"cardinality": "SINGLE","isLegacyAttribute": true},"endDef2": {"type": "rdbms_table","name": "foreign_key_references","isContainer": false,"cardinality": "SET"},"propagateTags": "NONE"
}
关联关系:外键由几个字段构成,字段被哪些外键引用
{"name": "rdbms_foreign_key_column_references","serviceType": "rdbms","typeVersion": "1.2","relationshipCategory": "ASSOCIATION","relationshipLabel": "__rdbms_foreign_key.references_columns","endDef1": {"type": "rdbms_foreign_key","name": "references_columns","isContainer": false,"cardinality": "SET","isLegacyAttribute": true},"endDef2": {"type": "rdbms_column","name": "foreign_key_references","isContainer": false,"cardinality": "SET"},"propagateTags": "NONE"
}
详情
tableA:id,[classId,className](外键)tableB:classId,className外键实体:
references_table:tableB
table:tableA
references_columns:classId,className例子说明:tableA,有一个外键,由[classId,className]构成tableB,有两个字段,是tableA的外键外键实体,属于tableA的,被tableB引用,这个外键引用两个字段[classId,className]