File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes OR-MAPPING ISSUE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "OR-MAPPING ISSUE" Watch "OR-MAPPING ISSUE" New topic


ashirvad jain
Ranch Hand

Joined: Nov 09, 2006
Posts: 50
Hello friends,
I am bit confuse about mapping between two class/tables.
I working on one project which maintains,
question(id,sub_id,que_Text) and answer(id,que_id,ansText) 2 tables.
Now question of thinking is ,like we know we can set multiple answer for question in "answer" table so do i need to maintain(one-many relation).
But at the same time we know that question can have multiple/single answers. So what kind of relationship is better to perform??
And if you can suggets me some nice thoughtof it,its great for me....

Thanks In Advance
ashirvad jain
Ranch Hand

Joined: Nov 09, 2006
Posts: 50
I am thinking of one-many relation(due to multiple/single answer).

Any other nice suggestion??
M.S. Hossen

Joined: Jan 02, 2009
Posts: 2
In this situation I think 1:M is better, because you have to consider multiple answer.
I agree. Here's the link:
It's not a secret anymore!