Solved

many-many relationship

Posted on 2011-09-06
3
190 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
Comment Utility

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
Comment Utility
>>
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
Comment Utility
?
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
factorial example challenge 10 61
allStar challenge 1 41
mapBully challenge 6 88
advertisement module in core php 4 79
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

772 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

12 Experts available now in Live!

Get 1:1 Help Now