Jason Zhicheng Li wrote:
<SNIP>
You cannot use indexed collection on the many end.
Hope this helps.
No, that's not entirely correct. When
not using inverse="true" on the parent side, this
wil work in Hibernate 3. Gavin King confirmed this in a thread related to my question on this kind of mappings:
http://forum.hibernate.org/viewtopic.php?t=943384
BTW, I strongly suspect that this has nothing to do with the fact that I used a mapping that's bi-directional. The issue is that Hibernate creates a List of size 7, probably based on the max index of all returned elements, and uses the index of the children to fill it, while the filtered query only returns 5 elements. When a filter is applied to the query, the maximum index of the returned elements does
not always repesent the number of elements + 1 in the resulting List.
Receiving a List which has null-entries and whose size() is not representing the actual number of found instances is really annoying. (and hopefully a bug, so it can be fixed, and not a feature...)
If this is how Hibernate is supposed to work, can anybody please explain the rationale behind the current implementation?