I am not using <list>, I am using <array>:
Code:
<array name="Items" table="OrderItems">
<key column="intOrderID"/>
<index column="intSortKey"/>
<one-to-many class="OrderItem"/>
</array>
All the solutions I was able to find suggest changing the object model, so that instead of an array I use some kind of IList or other collection class.
I need to use an array so that I have a strongly typed collection of items. It seems silly that I would need to change my object model to accomodate Hibernate. It should be the other way around, Hibernate should be able to accomodate any reasonable object model.
What seems natural to me would be something like:
Code:
<array name="Items" table="OrderItems">
<key column="intOrderID"/>
<sort column="intSortKey"/>
<one-to-many class="OrderItem"/>
</array>
Is there another way to achieve this in Hibernate?