Code:
public class A {
int id;
Map<String, B> b;
}
public class B {
int id;
int[] vals;
}
<class name="A">
<id name="id" access="field">
<generator class="native" />
</id>
<map name="b" access="field" cascade="all-delete-orphan">
<key />
<map-key type="string" />
<one-to-many class="B" /> <!-- maybe ur usecase may be different and u want many-to-many -->
</map>
</class>
<class name="B">
<id name="id" access="field">
<generator class="native" />
</id>
<array name="vals" access="field">
<key />
<list-index />
<element type="int"/>
</array>
</class>