Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Big question on relationships  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Imagine you have a many to many relationship as:

Student <-> Course

Whem I use CMR fields I get a relation table like:

RELATIONSHIP_STUDENT_COURSE (ID_STUDENT, ID_COURSE)

And I will have methods like course.addStudent and student.addCourse in each EntityBean.

BUT if I need to add more information about this relationship like a date or something else. How can I add that information?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 37249
519
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
F´┐Żbio,
Create a table/ejb to link the too.

So you would have a relationship between studentid and newTableId. Then another relationship between newTableId and courseId.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, we must have a reference table between two tables having many-to-many relationship.

please tell me if i am wrong.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!