I need to map a one-to-many relation as a Map<String, List<Contact>>, but i still did not find the solution.
Before the db update i was using the following mapping :
Code:
<class name="person" ....>
...
...
<map name="contacts" table="SP_CONTACT" lazy="false" cascade="all,delete-orphan" inverse="true">
<key column="SPC_SPR_ID" not-null="true" />
<map-key column="SPC_SCT_CODE" type="string" />
<one-to-many class="com.nexo.susan.be.model.Contact" />
</map>
...
...
</class>
To get all the contacts for a person indexed by the contact type in a
Map<String, Contact>
But a change has be done to get multiple contacts for a same contact type,
so we should have Map<String, List<Contact>>.
Is there a way to map this collection using a <map> or do i have to forget this and use HQL request to get the contacts and index them by myself ?
Thanks.
Christophe.