-->
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.  [ 3 posts ] 
Author Message
 Post subject: Need help mapping Map w/ List values
PostPosted: Fri Jun 17, 2005 4:53 pm 
Newbie

Joined: Fri Jun 17, 2005 4:35 pm
Posts: 3
Hi,

I have a class which contains a java.util.Map. The Map's keys are Strings, and the values are a List of classes. The docs say that you can't map a collection to a collection, so I was wondering if there was any way to map this, as it seems like it would be a fairly common use case. The child objects in this case are completely dependent on the parent objects.

Here's an example of what I'd like to do:

<class...>
<map name="categories"
table="categories"
lazy="false"
inverse="false"
cascade="all-delete-orphan"
order-by="category_order">
<key
column="PROJECT_ID">
</key>
<map-key column="role_cat_id" type="string"/>
<!--a list here is not allowed -->
<list name="map-values" table="map-values" lazy="true" inverse="false" cascade="all-delete-orphan">
<key column="PROJECT_ID"/>
<list-index column="ITEM_ORDER"/>
<composite-element
class="my.value.class">
<property
name="text"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="TEXT"/>
...
</composite-element>
</list>
</map>
</class>

Any ideas? If I did a one-to-many with a new List class, how would I map that? Any help greatly appreciated.

--Jason


Top
 Profile  
 
 Post subject: looks like no.....
PostPosted: Thu Aug 25, 2005 4:49 am 
Newbie

Joined: Fri Jan 21, 2005 2:30 pm
Posts: 5
http://forum.hibernate.org/viewtopic.php?t=939305

Although no reason is given


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 4:53 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
It can be done in 3.x using a usercollectiontype. It is certainly not trivial, however.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.