@XToX 带注释的字段的主要术语(最好是一个词)是什么?
问题几乎说明了一切。
您可以在此处阅读“实体关联”,但有“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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
“关联”和“关系”都用,都可以。
Both "association" and "relationship" are used and are fine.
根据 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.