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.  [ 2 posts ] 
Author Message
 Post subject: idbags. List, or Set ?
PostPosted: Wed Sep 05, 2007 7:24 am 
Newbie

Joined: Tue Apr 03, 2007 11:40 am
Posts: 7
Location: London
I have a collection of objects mapped with an idbag:

<idbag name="permissions" table="t_publication_permission">
<collection-id column="id" type="long">
<generator class="sequence">
<param name="sequence">s_publication_permission_id</param>
</generator>
</collection-id>
<key column="publication" not-null="true" />
<many-to-many column="permission" class="uk.gov.ukti.bpb.domain.user.Permission" fetch="join" />
</idbag>

All is fine if I use a List:
private List<Permission> permissions;

If i change to Set, I get Xcps:
org.springframework.orm.hibernate3.HibernateSystemException:
IllegalArgumentException occurred while calling setter of uk.gov.ukti.bpb.domain.user.Publication.groups

So my inital question is, is it possible to map a Set using an idbag, or must it be a List ?



Matt


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 05, 2007 9:57 am 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
A <set> must be mapped to an ISet. A <bag> and <idbag> must be mapped to an IList. Similarly, a <map> must be mapped to an IDictionary. Mixing and matching is not supported.

_________________
Karl Chu


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

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.