此图表不正确.它说Team
由Equipments
组成,如果Team
被删除,Equipments
将被删除.go 掉黑钻石就没事了.
By the way, the arrow is not wrong, but it is not necessary if your UML class diagram is meant for a relational model: the implementation of an association with an RDBMS will always make it bidirectional.
用户定义的数据类型是一种SQL特性,允许创建由多个元素组成的复合类型.目标是您可以使用新创建的类型,如内置类型.
如果您在postgresql中为您的模型创建了两个用户定义的类型,那么您无论如何都必须创建两个表,每个表都有一个给定类型的列(更多解释here).因此, Select SQL类型来实现UML类并没有决定性的优势.
如果您使用的是值对象,那么在SQL中创建类型最为可取.值对象没有标识,仅由它们所承载的值定义.它们通常是相同或不同类/表中多个属性的类型.
By the way, in an UML model, you should in principle represent value types with 100 classifiers. But some people model such value types with normal classes and it's a topic of discussion.
业务应用程序中的值对象的一个典型示例是由货币值和货币代码组成的CurrencyAmount
.