@XToX 带注释的字段的主要术语(最好是一个词)是什么?

发布于 2024-11-05 22:00:45 字数 596 浏览 3 评论 0原文

问题几乎说明了一切。

您可以在此处阅读“实体关联”,但有“relationship” 此处

哪个术语是主要术语? (抱歉,我无权访问 JPA 规范。)

“Entity”基本上只是指定对用 @Entity 标记的类的引用,因此基本问题是在关联、关系或其他之间进行选择。

当然,关联是 UML 术语,表示“真实”类(实体、复合 PK 类、枚举等)之间的各种引用,也就是说,据我所知,不一定是对 Java 简单“包装器”之一的引用“整数、字符串、布尔值等类型。关系是关系术语,更好地表示每个 @XToX/@JoinColumn(s) 字段实际上代表一个外键这一事实。这就是我正在寻找的。

那么,在 JPA 中我们谈论的是关联吗?关系?另一个术语? (我倾向于更喜欢“关系”,因为它代表外键。)

Question pretty much says it all.

You can read "entity association" here, but there's "relationship" here

Which term is the primary one? (Sorry, I don't have access to the JPA spec.)

"Entity" basically just designates a reference to a class tagged with @Entity, so the basic question is to choose between association, relationship, or another.

An association of course is the UML term for all kinds of references between "real" classes (entity, composite PK class, enums etc.), that is - as I understand it - not necessarily a reference to one of the Java simple "wrapper" types like Integer, String, Boolean etc. A relationship is the relational term and better represents the fact that every @XToX/@JoinColumn(s) field actually represents a foreign key. This is what I'm looking for.

So, in JPA are we talking about associations? Relationships? Another term? (I tend to prefer "relationship" because of the fact that it represents a foreign key.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

傾城如夢未必闌珊 2024-11-12 22:00:45

“关联”和“关系”都用,都可以。

Both "association" and "relationship" are used and are fine.

如果没有你 2024-11-12 22:00:45

根据 JPA 规范,主要术语是“关系”。请参阅 JPA 2.0 规范 http://jcp.org/aboutJava/communityprocess/final/ jsr317/index.html

感谢 Christoffer Hammarström 发布链接。

According to the JPA spec the primary term is "relationship". See the JPA 2.0 spec http://jcp.org/aboutJava/communityprocess/final/jsr317/index.html

Thanks to Christoffer Hammarström for posting the link.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文