Solved

many-many relationship

Posted on 2011-09-06
3
204 Views
Last Modified: 2012-05-12
I was trying to understand about many-many relationship. Say many customers have many phone numbers. How does it impact single customer. Like Single customer always have many phones(like home phone, mobile phone, office phone number etc ). Then that becomes one-many relationship right not many-many. Thanks in advance
0
Comment
Question by:gudii9
  • 2
3 Comments
 
LVL 47

Accepted Solution

by:
for_yan earned 250 total points
ID: 36492745

check example this example:

say one stock can belong to many categories - say commodities, big company

and one category cabn conating many duifferent stocks

look at details here:


http://www.mkyong.com/hibernate/hibernate-many-to-many-relationship-example/
0
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 250 total points
ID: 36493871
>>
Like Single customer always have many phones(like home phone, mobile phone, office phone number etc ). Then that becomes one-many relationship right not many-many.
>>

When you think about N-N relationships, it's helpful to think of database use cases.
In a situation like you mention above (customer, phones and many-many), the following use cases spring to mind:

1. Given a customer, find their phone number(s)
2. Given a phone number, find to which customer(s) it belongs

The second one is made possible by many to many. Phone number X could belong to customers Y or Z, because Y and Z live at the same address
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 36585704
?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now