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

Adding associations to a join entity..

 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm running into some errors when trying to hang supplementary associations off of a join entity.


Ie StudioCompetition is a join entity that replaces a direct M:M between Affiliation and Competition that provides a place to hang additional qualifies of the association.

I can't seem to figure out how to allow hook up the extra associations -- I get errors regarding the number of columns in the foreign key.

My current setup looks like:

which yields an error like:


Earlier I had the association on the StudioSessionPrice named "affiliation" of Type Affiliation... so it wasn't really bi-directional (more of a loop). Which fails with a similar error message -- different wording, but same general intent -- wrong number of columns.. That error made sense since I had the mapped by of something with a two column PK mapped by a single column/wrong type. So I switched to the code shown above.

Is there a way to back the supplementary association work? Or do I need to lose the compound primary key, add an artificial key to the join table and just treat it like a regular entity?
[ December 25, 2008: Message edited by: Eric Nielsen ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic