I'm using a <list> to represent a collection for one of my business objects, but when the results get returned to me I get more than expected. For example, when I expect to have a collection of 3 objects I actually get one with 47 objects, 3 of which are the actual ones and the rest just being null (or nothing). What am I doing wrong?
Here's an example of my mapping files...
<class name="Cart" table="tCarts" proxy="ICart">
<id name="ID" column="ID">
<generator class="native" />
</id>
<list name="CartItems" lazy="false" fetch="join" cascade="save-update">
<key column="CartID" />
<index column="ID" />
<one-to-many class="CartItem" />
</list>
</class>
<class name="CartItem" table="tCartItems" proxy="ICartItem">
<id name="ID" column="ID">
<generator class="native" />
</id>
<many-to-one name="ParentCart" column="CartID" class="Cart" fetch="join" />
</class>
|