persistence@glassfish.java.net

Re: "Invalid composite primary key specification"

From: Jeffrey Blattman <jeffrey.blattman_at_gmail.com>
Date: Wed, 08 Aug 2007 12:14:20 -0700

Markus Fuchs wrote:
>>>>
>>>> /Exception Description: The @JoinColumns on the annotated element
>>>> [private com.sun.portal.pom.Entity
>>>> com.sun.portal.pom.Preference.entity] from the entity class [class
>>>> com.sun.portal.pom.Preference] is incomplete. W*hen the source
>>>> entity class uses a composite primary key, a @JoinColumn must be
>>>> specified for each join column using the @JoinColumns.* Both the
>>>> name and the referenceColumnName elements must be specified in each
>>>> such @JoinColumn.
>>>> /
>>> Looks like you used /_at_JoinColumn*s*. Please check.
>>>
>>> /
>> no, i didn't. the message is telling me that i need to specify >1
>> @JoinColumn's, and use a @JoinColumns to contain them. i think.
>>
> You are completely right. I was confused. Could you please send us
> your entity classes. This would help very much in resolving your issue.
>
>
i'm attaching a .zip of the project. if you have the time, it'd be nice
if you could confirm i'm doing this correctly. what i have *seems* to
work, but i only have minimal test cases at this point.

please note that i have an entity class named "Entity", so sorry for the
confusion on that.