Meaningless Drivel is fun!*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Related to  Entity Relationships. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Related to  Entity Relationships." Watch "Related to  Entity Relationships." New topic
Author

Related to Entity Relationships.

pradeep singh
Ranch Hand

Joined: Oct 23, 2007
Posts: 339
Hi to all
Could you anybody explain me in detail the numbers denoted on entity diagrams of showing OneToMany and ManyToOne mapping at page no. 244 and at page no. 247 in EJB in Action book.The numbers are like 1 ,0..* ,1..* etc.
Please explain me in detail .I am very confused about these.


SCJP 5.0(75%), SCWCD 5.0(88%)
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Multiplicity is explained page 223. Is there anything you don't understand from this explanation ?


[My Blog]
All roads lead to JavaRanch
pradeep singh
Ranch Hand

Joined: Oct 23, 2007
Posts: 339
Hi
Thankx
But i want to know what these numbers denote ?
The numbers are like 1 ,0..* ,1..*


Please explain me these with some examples.
[ November 16, 2008: Message edited by: pradeep singh ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

"1" means "only one". "*" means "many". So, "0..*" means "zero or any number of". I find figure 7.3 self explanatory. Look at Bid and Bidder. Bid(0..*)<----(1)Bidder. It means that a Bidder can place many Bid, and a Bid is placed by only one Bidder. The relation between Item and Category is Item(0..*)<---->(1..*)Category. It means that an Item belongs to one or more Category, and a Category can hold many Item.

For example:
Category : Sport,Cloth,Television,Game
Item : Football Shirt

The Item "Football Shirt" may belong to Category "Sport" and "Cloth". This Item has two Category. Category "Sport" now has one item. "Cloth" also has one item. "Television" and "Game" still have no Item.
pradeep singh
Ranch Hand

Joined: Oct 23, 2007
Posts: 339
Thankx Christophe Verre
 
jQuery in Action, 2nd edition
 
subject: Related to Entity Relationships.
 
Similar Threads
Reference variable casting
Declaration
why the below highlighted statement is unreachable
boxing method call doubt
basic doubt regarding ==