• 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 ...
  • Campbell Ritchie
  • Tim Cooke
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

Foreign key to primary key one-to-one join

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey folks I've been searching everywhere trying to find an answer to this problem to no avail so i throw myself at your mercy. I am trying to get a pretty simple join to work and am finding it surprisingly difficult. Here is a rough outline of what i'm trying to do:

I'm basically just trying to collect data from these 3 tables like so:

I got the primary key to primary key join to work fine with a simple one-to-one element. I cannot get the foreign key to primary key to work at all though. I've tried one to one elements that look like:

But i think i am using formula wrong. How can i tell hibernate to join the foreign key of the master table to the primary key of the associated table? I can't seem to find an example in the docs that does this. I have also tried many to one unique=true associations with no more luck.

EDIT: I'm using Hibernate3

Any help would be greatly appreciated.
Too many men are afraid of being fools - Henry Ford. Foolish tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic