Joined: Mon Oct 04, 2004 5:33 pm Posts: 2 Location: Austin, Tx
|
Hibernate version:2.1.6
Below is a System.out and stack trace that I added to the set method of a mapped class which takes a collection. Note the size of the List set into my object is 100000 even though the generated sql only returns some 15 rows.
I cannot see anything abnormal in the debug statements. Any suggestions would be appreciated.
[java] net.sf.hibernate.collection.List:size=100000
[java] java.lang.Exception: Stack trace
[java] at java.lang.Thread.dumpStack(Thread.java:1064)
[java] at com.activant.biz.inventory.impl.LineImpl.setSubLinesLineImpl.java:49)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:324)
[java] at net.sf.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:38)
[java] at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:222)
[java] at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2210)
[java] at net.sf.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:315)
[java] at net.sf.hibernate.loader.Loader.doQuery(Loader.java:305)
[java] at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
[java] at net.sf.hibernate.loader.Loader.doList(Loader.java:1033)
[java] at net.sf.hibernate.loader.Loader.list(Loader.java:1024)
[java] at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854)
[java] at net.sf.hibernate.impl.SessionImpl.findSessionImpl.java:1544)
[java] at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
Here's the relevant mapping information. I question whether this is a mapping problem because the generated sql is correct and I only see the returned rows getting intialized. Behavior is consistent when lazy if true and false.
<subclass name="com.activant.biz.inventory.impl.LineImpl"
proxy="com.activant.biz.inventory.model.Line"
lazy="true"
discriminator-value="L">
<list name="subLines" lazy="false" where="CLASS='S'">
<key column="PARENT_ID"/>
<index column="LINE_SEQ"/>
<one-to-many class="com.activant.biz.inventory.impl.SubLineImpl"/>
</list>
<set name="items" lazy="true" inverse="true" sort="natural">
<key column="LINE_ID"/>
<one-to-many class="com.activant.biz.inventory.impl.ItemImpl"/>
</set>
</subclass>
<subclass name="com.activant.biz.inventory.impl.SubLineImpl"
proxy="com.activant.biz.inventory.model.SubLine"
lazy="true" discriminator-value="S">
<set name="items" lazy="true" inverse="true" sort="natural">
<key column="SL_ID"/>
<one-to-many class="com.activant.biz.inventory.impl.ItemImpl"/>
</set>
</subclass>
|
|