• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem for fetching results from 2 tables which do not have relation...

 
Sharath D Chandra
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I have a problem here....I have 2 tables, STUDENTS with studentId column, but its not primary key and I have a one more table GAMES with auto generated primary key and studentId and here also studentId is not primary key. These tables do not have any relation in db, but I need to fetch results of games for a student when I fetch a student record, ie one student gets N number of games when fetched by using fetchtype as eager. but the problem is that there is no relation.
My doubt is that, can we fetch the details of the games of a student by explicetly putting a one to many mapping in the hbm file or may be by configering by annotations.

Thanks,
Sharath
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic