views:

85

answers:

1

Hello i have an Entity Exam

 @Id
    @GeneratedValue(strategy=GenerationType.TABLE)
    private Long id;
    .....
    ......

    @ManyToMany
    private List<Exam> exams;

    @ManyToMany(mappedBy="id")
    private List<Exam> parentExams;

The problem is that

@ManyToMany
        private List<Exam> exams;

is ok works great...

but this doesnt validate?!

 @ManyToMany(mappedBy="id")
        private List<Exam> parentExams;

Any idea what to do ? I just want to get the exams that are parents of the current exam.

Διεθνές Νομισματικό Ταμείο

A: 

SOLVED.

mappedBy="id" should be mappedBy="exams"

Parhs
PLease accept your answer and that will mark the question as being answered, thx
Romain Hippeau
if only i could...
Parhs