开发者

What is the (preferrably one-word) primary term for @XToX annotated fields?

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开发者_StackOverflow社区, 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.)


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜