Hi Fernadez,
The error describes ObjNegocio.Afiliado entity class that may be referencing
to Services entity which has ServicesPK composite PK. It means you should
specify @JoinColumns fully on ObjNegocio.Afiliado class when refering to
Services entity.
Also, you specified @JoinTable as well as @Column in ServicesPK embeddable
class, it's wrong. @JoinTable should be specified on relationship fields
(which has @ManyToMany for example). The fields in ServicesPK should have
only @Column annotations.
Cheers,
-Wonseok
On 2/21/07, Fernadez Eduardo <pachif81_at_yahoo.com.ar> wrote:
>
> *Hello People*:
> I'm student and I be working with toplink since a month. An I find a
> problem discribed like this
>
> The @JoinColumns on the annotated element [private java.util.List
> ObjNegocio.Afiliado.listaserv] from the entity class [class
> ObjNegocio.Afiliado] is incomplete. When 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.
>
> What i try to do is get a list of services of a specific employee, and the
> service entity have a compound query, and the key is embeded in a ServicesPK
> class
>
> Here is my Code:
>
> @Embeddable
> public class ServicioPK implements Serializable {
>
> @JoinTable(name="employee",joinColumns=
> @JoinColumn(name="idemployee",referencedColumnName="idemployee")
> )
> @Column(name = "idemployee", nullable = false)
> private int idemployee;
> @JoinTable(name="Instit",joinColumns=
> @JoinColumn(name="idInstit",referencedColumnName="idInstit")
> )
> @Column(name = "idInstit", nullable = false)
> private int idInstit;
> @JoinTable(name="Charge",joinColumns=
> @JoinColumn(name="idCharge",referencedColumnName="idCharge")
> )
> @Column(name = "idCharge", nullable = false)
> private int idCharge;
>
>
> *The Question are?*
>
> - What is wrong with the code that I Wrote,and how I should correct
> them?
> - If you have any direction or thread treating this problem?
>
>
> Thanks before all, i know that my restlessness will costs part of you valuable
> time
>
>
> ------------------------------
> *Preguntá. Respondé. Descubrí.*
> Todo lo que querías saber, y lo que ni imaginabas,
> está en *Yahoo! Respuestas* (Beta).
> *Probalo ya! <http://ar.answers.yahoo.com>*
>
>