• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic