Hi all,
I'm trying to have a bidirectional relation with the ManyToOne being part of a composite primary key, but the corresponding OneToMany relation can't find the property as soon as I add @Id. E.g.
Code:
@Entity
public class Race {
@Id @GeneratedValue
private long id;
@OneToMany(mappedBy="race")
private List<Run> runs;
...
}
@Entity
public class Run implements Serializable {
@Id @ManyToOne
private TimedRace race;
@Id
private int number;
...
}
The error is "mappedBy reference an unknown target entity property: Run.race in TimedRace.runs".
Apologies if this is a silly mistake, but I've not been able to find a solution.
Thanks
Pete