Hey everybody!
Hopefully I am not asking stupid thing again, but here I go :)!
I have an Object called "Akquise" which has several statistic-entries.
Since that Statistic-Table is somewhat big, I would like to use lazy-init on the respective collection:
Code:
<list name="statistics" lazy="true">
<key column="BATCHLFDNR" />
<index column="ZEILE" />
<one-to-many class="az.dias.miner.application.dao.AkquiseStatistik"/>
</list>
All works so far. My code to retrieve the statistik at the point where I need it looks this way:
Code:
Akquise a = (Akquise) session.get(Akquise.class,new Integer(id));
for(Iterator i = a.getStatistics().iterator(); i.hasNext();)
{
AkquiseStatistik as = (AkquiseStatistik) i.next();
System.out.println(as);
}
Now I have the following problem. The first element in the returnend iterator is always
null. I could work around that, but I'd rather like to know if this is normal, or if I do something wrong.
Thx for the help!
Console-Log:
Code:
13:37:03,207 INFO [STDOUT] null
13:37:03,207 INFO [STDOUT] az.dias.miner.application.dao.AkquiseStatistik@44333b16
13:37:03,207 INFO [STDOUT] az.dias.miner.application.dao.AkquiseStatistik@44333b16
13:37:03,207 INFO [STDOUT] az.dias.miner.application.dao.AkquiseStatistik@44333b16
13:37:03,207 INFO [STDOUT] az.dias.miner.application.dao.AkquiseStatistik@44333b16
13:37:03,207 INFO [STDOUT] az.dias.miner.application.dao.AkquiseStatistik@44333b16
13:37:03,207 INFO [STDOUT] az.dias.miner.application.dao.AkquiseStatistik@44333b16
13:37:03,207 INFO [STDOUT] az.dias.miner.application.dao.AkquiseStatistik@44333b16