Hibernate version:
Hibernate Core 3.2.CR2
Hibernate Annotations 3.2.0 CR1
Hibernate EntityManager 3.2.0 CR1
Hibernate Tools 3.1 beta 5
Mapping documents:
Code:
@ManyToMany(fetch=FetchType.EAGER)
@JoinTable(name="brokerproducts",
joinColumns=@JoinColumn(name="brokerid"),
inverseJoinColumns=@JoinColumn(name="productid"))
private Collection<Product> products;
Using a Collection for a ManyToMany relationship fails when I specify FetchType.EAGER. The error is
[hibernatetool] java.lang.reflect.InvocationTargetException
[hibernatetool] javax.persistence.PersistenceException: org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
[hibernatetool] org.hibernate.HibernateException: cannot simultaneously fetch multiple bags
This happens using the Hibernate Tools <ejb3configuration /> and <hbm2ddl> so I don't have a stacktrace.