• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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
 
The government thinks you are too stupid to make your own lightbulb choices. But this tiny ad thinks you are smart:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic