Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ankit Chandrawat
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator





Is there anything else that needs to be done as the I am not being able to fetch the object ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic