• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about Pro Hibernate 3.0 book, it has Odd (wrong?) schema design...

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post
I am reading pro hibernate 3.0 book and in chapter 2 i saw an odd design of schem.
here is the image of its class diagram that will go to be the the data model.


what does its relations say:
It it was me , i create a user table, a phone table and then i add ID of phone records to each user record , i mean :
a user table with:

id
name
password
PhoneID

which phoneID is referenced to phone table primary key(foriegn key)

am i mistaken ?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a class diagram and not a database model diagram.

A User can have many phone numbers, so the userId will be stored in the phone table.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic