identifying-relationship

Data Modeling: Logical Modeling Exercise

我只是一个虾纸丫 提交于 2019-12-29 11:41:28
问题 In trying to learn the art of data storage I have been trying to take in as much solid information as possible. PerformanceDBA posted some really helpful tutorials/examples in the following posts among others: is my data normalized? and Relational table naming convention. I already asked a subset question of this model here. So to make sure I understood the concepts he presented and I have seen elsewhere I wanted to take things a step or two further and see if I am grasping the concepts.

Can a weak entity be involved in both identifying and non-identifying relationships with other tables?

别来无恙 提交于 2019-12-24 09:11:08
问题 Obviously a weak entity must be involved (as the child) in one or more identifying relationships, otherwise it would not be weak. But can it, at the same time, also be the child in a non-identifying relationship? 回答1: Yes, weak entity sets can participate in non-identifying relationships with other entities . By "child", I suppose you mean relationships in which the weak entity set is on the determining (many) side of the relationship. There is no restriction on the kinds of relationships in

Trouble deciding on identifying or non-identifying relationship

≡放荡痞女 提交于 2019-11-29 19:45:49
I've read this question: What's the difference between identifying and non-identifying relationships? But I'm still not too sure... What I have is three tables. Users Objects Pictures A user can own many objects and can also post many pictures per individual object. My gut feeling tells me this is an identifying relationship, because I'll need the userID in the objects table and I'll need the objectID in the pictures tables... Or am I wrong? The explanations in the other topic limit themselves to the theoretical explanation of the way the database interprets it after it's already been coded,

Trouble deciding on identifying or non-identifying relationship

一笑奈何 提交于 2019-11-28 15:33:19
问题 I've read this question: What's the difference between identifying and non-identifying relationships? But I'm still not too sure... What I have is three tables. Users Objects Pictures A user can own many objects and can also post many pictures per individual object. My gut feeling tells me this is an identifying relationship, because I'll need the userID in the objects table and I'll need the objectID in the pictures tables... Or am I wrong? The explanations in the other topic limit

JPA: difference between @JoinColumn and @PrimaryKeyJoinColumn?

狂风中的少年 提交于 2019-11-27 06:22:10
What's the exact difference between @JoinColumn and @PrimaryKeyJoinColumn ? You use @JoinColumn for columns that are part of a foreign key. A typical column could look like (e.g. in a join table with additional attributes): @ManyToOne @JoinColumn(name = "...") private OtherClass oc; What happens if I promote the column to be a/the PK, too (a.k.a. identifying relationship)? As the column is now the PK, I must tag it with @Id : @Id @ManyToOne @JoinColumn(name = "...") private OtherClass oc; Now the question is: Are @Id + @JoinColumn the same as just @PrimaryKeyJoinColumn ?: @ManyToOne

JPA: difference between @JoinColumn and @PrimaryKeyJoinColumn?

落爺英雄遲暮 提交于 2019-11-26 12:53:15
问题 What\'s the exact difference between @JoinColumn and @PrimaryKeyJoinColumn ? You use @JoinColumn for columns that are part of a foreign key. A typical column could look like (e.g. in a join table with additional attributes): @ManyToOne @JoinColumn(name = \"...\") private OtherClass oc; What happens if I promote the column to be a/the PK, too (a.k.a. identifying relationship)? As the column is now the PK, I must tag it with @Id : @Id @ManyToOne @JoinColumn(name = \"...\") private OtherClass oc

Still Confused About Identifying vs. Non-Identifying Relationships

感情迁移 提交于 2019-11-26 10:07:30
问题 So, I\'ve been reading up on identifying vs. non-identifying relationships in my database design, and a number of the answers on SO seem contradicting to me. Here are the two questions I am looking at: What\'s the Difference Between Identifying and Non-Identifying Relationships Trouble Deciding on Identifying or Non-Identifying Relationship Looking at the top answers from each question, I appear to get two different ideas of what an identifying relationship is. The first question\'s response

What's the difference between identifying and non-identifying relationships?

谁都会走 提交于 2019-11-25 23:35:49
问题 I haven\'t been able to fully grasp the differences. Can you describe both concepts and use real world examples? 回答1: An identifying relationship is when the existence of a row in a child table depends on a row in a parent table. This may be confusing because it's common practice these days to create a pseudokey for a child table, but not make the foreign key to the parent part of the child's primary key. Formally, the "right" way to do this is to make the foreign key part of the child's