Ich verwendete @ManyToMany
Annotation auf einem Set und es hat gut funktioniert.Welche Sammlungen werden unterstützt von Hibernate @ManyToMany Annotation
@ManyToMany
@JoinTable(name="stud_course_map",joinColumns={@JoinColumn(name="stud_id ")}, inverseJoinColumns={@JoinColumn(name="course_id")})
public Set<Course> getEnrolledCourses() {
return enrolledCourses;
}
Wenn verwendete ich Arraylist statt Set es Ausnahme Arraylist wird nicht unterstützt
org.hibernate.AnnotationException: Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements: com.kaushik.winnersoft.data.Student.enrolledCourses
wirft? Welche Sammlung wird von @ManyToMany
Annotation unterstützt?
FWIW, andere JPA-Anbieter unterstützen eine vollständige Palette deklarierter Collection-Typen. –