3.1.2
Mapping documents:
<list name="referenceList">
<key column="parenttableModelId"/>
<list-index column="id"/>
<one-to-many class="com.myvision.model.Reference"/>
</list>
Code between sessionFactory.openSession() and session.close():
Session s = HibernateUtil.currentSession();
Criteria c = s.createCriteria(TableModel.class);
List<TableModel> list = c.list();
for (TableModel tableModel: list) {
if(tableModel!=null) {
System.err.println( tableModel.getReferenceList().size() );
}
}
HibernateUtil.closeSession();
MYSQL 4 [b]
[b] sql
select referencel0_.parenttableModelId as parentt11_1_, referencel0_.id as id1_, referencel0_.id as id186_0_, referencel0_.lastModified as lastModi2_186_0_, referencel0_.creationDate as creation3_186_0_, referencel0_.version as version186_0_, referencel0_.defaultValue as defaultV5_186_0_, referencel0_.name as name186_0_, referencel0_.ordr as ordr186_0_, referencel0_.property as property186_0_, referencel0_.selectionPath as selectio9_186_0_, referencel0_.showInTable as showInT10_186_0_
from reference referencel0_ where referencel0_.parenttableModelId=167
java
private java.util.Collection referenceList ;
list impl
PersistentList
Hi All,
I always have a lot of null objects in the PersistentList. I also have the objects that should be there. When I iterate the list I get null from it.next(). The size() method gives also around 700 while there are only 11 real entries.Does anybody know what can be wrong?
grts,
Dennis
|