This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes one-to-many mapping with table having no primay key Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "one-to-many mapping with table having no primay key" Watch "one-to-many mapping with table having no primay key" New topic
Author

one-to-many mapping with table having no primay key

Ankit Chandrawat
Ranch Hand

Joined: Jan 03, 2008
Posts: 78
Hi,

I have two tables:



none of the columns in Table2 is primary key. How do I establish a one-to-many relationship between table1(id_chat_Session) and Table2.I have read that, using composite key can be an option. I can make both the columns as composite key of the table. But how do I map the column id_Chat_session in table1 and table2(id_chat_Session,id_user).

Ankit Chandrawat
Ranch Hand

Joined: Jan 03, 2008
Posts: 78





Is there anything else that needs to be done as the I am not being able to fetch the object ?
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: one-to-many mapping with table having no primay key
 
Similar Threads
Foreign key access problem
Hibernate: Different Join in Save() and Get()
How do I map this?
Problem with joining of two tables with Hibernate
Composite Foreign Key that maps to Unique Constraint