Hibernate version: 3.1
Name and version of the database you are using: SQL Server
The following use of <list> and <list-index> results in a java.util.List of 8 elements with a null for the 4th and 6th element. I was expecting a List of 6 elements where the missing 4 and 6 is ignored.
Is this correct behaviour?
Many thanks,
PS: I do rate :-)
Mapping documents:
Code:
<class name="eg.Stage" table="stage">
<list name="elements" inverse="true" cascade="all">
<key column="stage_id"/>
<list-index column="sequence" base="1"/>
<one-to-many class="eg.Element"/>
</list>
</class>
Code:
select * from element where stage_id = ?;
gives:Code:
id stage_id sequence
----------- ----------- -----------
573 708 1
574 708 2
575 708 3 <-- Note 4 is missing
576 708 5 <-- Note 6 is missing
577 708 7
578 708 8
Code:
stage.getElements().toString();
gives:Code:
[1, 2, 3, null, 5, null, 7, 8]