It appears that openjpa currently does not support MapKey annotation applied to 
a relation field. This, however, is not explicitly stated in the user guide or 
JPA 2.0 spec. Please open a JIRA for it. Thanks!




----- Original Message ----
From: Michael Vorburger <[email protected]>
To: [email protected]
Sent: Thursday, April 2, 2009 8:00:28 AM
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.

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.


     

Reply via email to