-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: ManyToMany fails using FetchType.EAGER and Collection
PostPosted: Thu May 25, 2006 12:52 pm 
Newbie

Joined: Fri Aug 13, 2004 12:49 pm
Posts: 10
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.