Hibernate seemed to have problem mapping a collection of values in one of my classes causing the ConcurrentModificationException. For the sake of discussion, let's have the following classes:
Code:
@Entity
class A {
@Id @GeneratedValue
@Column(updatable = false, insertable = false)
private Long id;
@org.hibernate.annotations.CollectionOfElements
@JoinTable(name = "A_B", joinColumns = @JoinColumn(name = "id"))
@org.hibernate.annotations.MapKey(columns = @Column(name = "MapKey"))
private Map<String, B> m;
}
@Embeddable
class B {
@org.hibernate.annotations.CollectionOfElements
@Column(nullable = false)
private Set<C> set = new HashSet<C>();
}
@Embeddable
class C {
@Column(nullable = false)
String f1;
@Column(nullable = false)
String f2;
}
I still don't understand why Hibernate always threw the ConcurrentModificationException whenever I uncommented the field "m" in class A. Could someone in the Hibernate team provide some insights here?
Regards,
William