2 类 之间的 UML 关系是什么,它们具有彼此的数据库 ID,但彼此没有引用?

What would be the UML relationship, between 2 classes which have the database id of the other, but do not have references to each other?

类会是普通对象,java中的pojos,它们之间的UML关系是什么,或者没有,但它们会与其他类 使用它们?

invoice_id 外键表示 InvoiceInvoiceLine 之间存在结构关系。因此,您可以在 class 图中将其表示为一个关联。 Invoice0..*InvoiceLine 侧的推导 1

该技术是一些作者称为“foreign key mapping”的 ORM 的 classic。使用软标识符而不是对象引用也很常见,尤其是在复杂的现实生活领域中,以避免在您只从数据库中获取一个对象时加载所有相关对象。

您可以使用 {id} 修饰符来记录主键:

A Property may be marked (...) as being (part of) the identifier (if any) for Classifiers of which it is a member. The interpretation of this is left open but this could be mapped to implementations such as primary keys for relational database tables or ID attributes in XML.
-UML 2.5.1 specifications