Sorry to bother – perhaps this is a very simple question – but for some reason the version below fails to get parsed, whereas the version with set works fine. In fact, if I just take the set version and replace set with list I get:
nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from invalid mapping
Thank you
Misha
<!-- bi-directional one-to-many association to SpreadsheetImportTemplateColumn -->
<list name="columns">
<!--
<set name="columns" lazy="false" inverse="true"
cascade="all-delete-orphan" sort="natural"
order-by="voided asc, preferred desc, date_created desc">
-->
<key column="template_id" not-null="true" />
<!--
<one-to-many class="SpreadsheetImportTemplateColumn" />
</set>
-->
</list>
You said
Here goes list DOCTYPE
Ass you can see, list element needs either index or list-index element, a key element, and one of the following
Here goes list-index DOCTYPE
So you should use
But if you want to use a list instead of a set and does not have a list-index column, you can use a bag instead. Initialize as follows
And define this mapping instead