File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Adding associations to a join entity..

 
Eric Nielsen
Ranch Hand
Posts: 194
  • 0
  • Mark post as helpful
  • send pies
  • 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 ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic