Skip to main content
added 399 characters in body
Source Link
parsecer
  • 5.2k
  • 20
  • 86
  • 171

Another way of thinking about the two uni-directional relations above could be as follows: if Person contains a List of documents they've written, the Document can also 'write' a Person, but only one. That is, an independent action is implied by each class. So one Person writes several documents (and a document can only be written by one person), and a Document writes only one Person (but several Documents can write the same Person).

The mapping would create not only tables PERSONS and ID_DOCUMENTS, but would also create a third association table PERSONS_ID_DOCUMENTS:

The mapping would create not only tables PERSONS and ID_DOCUMENTS, but would also create a third association table PERSONS_ID_DOCUMENTS:

Another way of thinking about the two uni-directional relations above could be as follows: if Person contains a List of documents they've written, the Document can also 'write' a Person, but only one. That is, an independent action is implied by each class. So one Person writes several documents (and a document can only be written by one person), and a Document writes only one Person (but several Documents can write the same Person).

The mapping would create not only tables PERSONS and ID_DOCUMENTS, but would also create a third association table PERSONS_ID_DOCUMENTS:

added 4 characters in body
Source Link
FUD
  • 5.2k
  • 7
  • 42
  • 63

Many times what we want is only a foreign key on table ID_DOCUMENTS towards PERSONSand not the extra association table.

Many times what we want is only a foreign key on table ID_DOCUMENTS towards PERSONSand the extra association table.

Many times what we want is only a foreign key on table ID_DOCUMENTS towards PERSONSand not the extra association table.

added 22 characters in body
Source Link
Angular University
  • 43.2k
  • 15
  • 79
  • 81

The mapping would create not only tables PERSONS and ID_DOCUMENTS, but would also create a third association table PERSONS_ID_DOCUMENTS:

Many times what we want is only a foreign key on table ID_DOCUMENTS towards PERSONSand nothe extra association table.

This means something like: "modifications on this side of the relation are already Mapped By by thethe other side of the relation IdDocument.person, so no need to track it here separately in an extra table."

The mapping would create not only tables PERSONS and ID_DOCUMENTS, but would also create a third table PERSONS_ID_DOCUMENTS:

Many times what we want is only a foreign key on table ID_DOCUMENTS towards PERSONSand no extra table.

This means something like: "modifications on this side of the relation are already Mapped By by the other side of the relation IdDocument.person, so no need to track it here separately in an extra table."

The mapping would create not only tables PERSONS and ID_DOCUMENTS, but would also create a third association table PERSONS_ID_DOCUMENTS:

Many times what we want is only a foreign key on table ID_DOCUMENTS towards PERSONSand the extra association table.

This means something like: "modifications on this side of the relation are already Mapped By the other side of the relation IdDocument.person, so no need to track it here separately in an extra table."

added 127 characters in body
Source Link
Angular University
  • 43.2k
  • 15
  • 79
  • 81
Loading
added 21 characters in body
Source Link
Angular University
  • 43.2k
  • 15
  • 79
  • 81
Loading
added 15 characters in body
Source Link
Angular University
  • 43.2k
  • 15
  • 79
  • 81
Loading
Source Link
Angular University
  • 43.2k
  • 15
  • 79
  • 81
Loading