-->
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: Best way to model map of maps
PostPosted: Fri Aug 13, 2010 11:11 am 
Beginner
Beginner

Joined: Tue Nov 03, 2009 9:38 am
Posts: 24
Hi,

we currently have the situation where we need a many-to-many association using a map of maps.
This is used to model language specific images if different types associated with a product, i.e.

Product 1
    language 'en'
      image of type 1
      image of type 2
    language 'de'
      image of type 1
      image of type 2

We'd like to have the possibility to use queries like "get all images in language 'en'" or "get the image of type 1 in language 'de'" both in HQL and Java.
So it seems that using an object as the map key (i.e. Map<KeyObject, Image>) would not be feasible and we'd need to either model the association as an entity or as Map<String, Map<Long, Image>> (meaning Map<language, Map<type, Image>>).

However, since we already had to model the many-to-many association (product<->image) using an entity (we're stuck with JPA 1.0 and thus Hibernate 3.3/3.4, btw) we're quite reluctant to add another entity for this and would prefer the map of maps approach.

Would that be possible?
Or would there be a better way (might be the additional mapping entity if there are good reasons)?


Thanks in advance.

Thomas


Top
 Profile  
 
 Post subject: Re: Best way to model map of maps
PostPosted: Mon Aug 16, 2010 8:31 am 
Beginner
Beginner

Joined: Tue Nov 03, 2009 9:38 am
Posts: 24
Any one?


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.