openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Vorburger" <mvorbur...@odyssey-group.com>
Subject Map field ... is attempting to use a map table, but its key is mapped by another field. Use an inverse key or join table mapping.
Date Thu, 02 Apr 2009 15:00:28 GMT
Hello!
 
Would anybody be able to enlighten us on how to "Use an inverse key or
join table mapping." with a @PersistentMap... I'm encoutering the "Map
field ...  is attempting to use a map table, but its key is mapped by
another field.  Use an inverse key or join table mapping." error
message.

Full test case reproducing this is attached... you'll find three
Entities, a Language, a Translation (with a field of type Language), and
a Something which has a Map<Language, Translation> ... sounds trivial?
;-)  -- That 'entity_dict_id' you'll find on the Translation is a kind
of "discriminator" (but not for subclassing, I need to use it to
"classify" the map association - imagine that in real world there is
SomethingElse and many other Entities which are also translated, all
stored in one and the same Translation table.)

I'm sure this is possible, I gathered standard JPA 1.0's @OneToMany with
a @MapKey can not do this, but with a @PersistentMap this should work...
only how?? Any help appreciated...
 
Thanks a lot,
Michael

____________________________________________________________

 This email and any files transmitted with it are CONFIDENTIAL and intended
  solely for the use of the individual or entity to which they are addressed.
 Any unauthorized copying, disclosure, or distribution of the material within
  this email is strictly forbidden.
 Any views or opinions presented within this e-mail are solely those of the
  author and do not necessarily represent those of Odyssey Financial
Technologies SA unless otherwise specifically stated.
 An electronic message is not binding on its sender. Any message referring to
  a binding engagement must be confirmed in writing and duly signed.
 If you have received this email in error, please notify the sender immediately
  and delete the original.
Mime
View raw message