File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes confusion on difference between one to many and many to one mapping. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "confusion on difference between one to many and many to one mapping." Watch "confusion on difference between one to many and many to one mapping." New topic
Author

confusion on difference between one to many and many to one mapping.

Monica. Shiralkar
Ranch Hand

Joined: Jul 07, 2012
Posts: 639
I have a confusion between one to many and many to one mapping.If state-city relation is one to many then city-state relation will be many to one.So it is the same thing from other end.One to many is many to one from other end and same way many to one is one to many from other end. so we have to never implement many to one relation because to implement that we can do one to many from other end.Please correct me if I am wrong.Thanks.
Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 505
    
    1

Hello!

I didn't understand very well what you wrote. For me many to one means
Table that represents side MANY has foreign key column whose values point to primary keys in table on ONE side. Many rows on MANY side point to single primary key on ONE side table.
And one to many relation says that primary key on ONE side is pointed many times on MANY side table by foreign key column.


True person is moral, false is right!
 
wood burning stoves
 
subject: confusion on difference between one to many and many to one mapping.