• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Joe Ess
  • salvin francis

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

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.

Yes, my master! Here is the tiny ad you asked for:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!