The business of mapping a Map is very confusing.
The docs and FAQ (
http://www.hibernate.org/329.html#A12) state that Map isn't fully supported, but "Hibernate Annotations does support Hibernate style Map mapping (ie explcit column for the map key) for Map<Element, ...> and Map<Embeddable, ...> (support for Map<Entity, ...> is expected later)".
However, looking at the changelog for my version of hibernate-annotations - 3.2.0.CR1 - there are a number of issues that have been recently been fixed in this area, e.g.
* Support for Map<Entity, Entity> -
http://opensource.atlassian.com/project ... se/ANN-327
*
http://opensource.atlassian.com/project ... se/ANN-281
The question is, is it now possible to easily persist the Map in this getter:
Code:
public Map<MyClassA, SortedSet<MyClassB>> getMyMap() {
return this.myMap;
}
with annotations? If so, how? Please provide as full as code as possible if you can, I only started learning hibernate yesterday :-)
Oliver