I have a List mapping in an object as below -
<class name="test.eventmodel.Alert"
table="Alert" lazy="false">
<cache usage="read-write" />
<id name="alertId" column="alertId">
<generator class="increment"/>
</id>
<property name="type" column="type" />
<list name="alertData" lazy="false" cascade="all,delete-orphan" >
<cache usage="read-write" />
<key column="alertId" />
<list-index column="AlertDataOrder" base="0" />
<one-to-many
class="test.eventmodel.AlertData" />
</list>
</class>
When I retrieve the 'Alert' object, I get the list of 'AlertData' in it with 'null' objects in places where no object was associated at that index.
Is there any way where I can retrieve Alert object with the alertData list NOT containig null values?
If not, what is the best way to compact the list by removing null values?
|