I don't understand exactly what you mean but this is not a simple one-to-many or many-to-one association.
It's a map association, suppose you have a map where the key is an object and the value is a list of objects:
Code:
class ClassA {
private HashMap associatedClassB;
ClassA() {
HashMap associatedClassB = new HashMap();
ClassC classC = new ClassC();
this.getAssociatedClassB(classC).add(new ClassB());
this.getAssociatedClassB(classC).add(new ClassB());
....
}
.....
public Map getAssociatedClassB() {
return this.associatedClassB;
}
}
To my understanding the mapping xml could be
Code:
<class
name="ClassA"
table="table_class_a"
>
<map
name="associatedClassB"
lazy="false"
sort="unsorted"
cascade="save-update"
>
<key column="associated_class_b_id"/>
<one-to-many
class="ClassB"
/>
<map-key-many-to-many column="associated_class_b_key"
class="ClassC"/>
</map>
</class>
but this is not the case, I receive the following error:
Code:
The content of element type "map" must match "(meta*,subselect?,cache?,synchronize*,comment?,key,(map-key|composite-map-key|map-key-many-to-many|index|composite-index|index-many-to-many|index-many-to-any),(element|one-to-many|many-to-many|composite-element|many-to-any),loader?,sql-insert?,sql-update?,sql-delete?,sql-delete-all?,filter*)".
that looks quite strange to me as it looks like all mandatory subelements are at their place...