Hi all,
In the last day i've been trying to solve a problem,
I have an entity called Competition thas has a relationship of oneToMany of Teams The competition has a relationship of oneToMany competitionAtlete The Teams entity as a relationship of oneToMany to competitionAtlete, ( and one competitionAtlete as only one team ).
pk in competition - id_competition - id_club
pk in competitionAtlete - id_competition - id_club - id_atlete
pk in Teams - id_competition - id_club - name
My issue is in competitionAtlete
the only way i get it to work is using @PrimaryKeyJoinColumns annotation but it creates new atributes to the foreign key instead of using the pk ones if i use the @JoinColumns i have to use insertable=false, updatable=false in the three elements, and the name attribute is not persisted.
i have find this sentence in the hibernate page: "It is part of the definition of a primary key that it is not only unique, but also constant throughout the life of the row. Hibernate does not, and should not, support changing identifier values."
help is apreciated
Thanks in advance, Nuno
|