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