Hi there,
i've got a performance problem with one of my "ont-to-many" bidirectional relations:
I have a one-to-many relation bewteen a costumer and his items:
Code:
<bag name="items"
inverse="true"
lazy="true"
access="field"
>
<key column="itemid"/>
<one-to-many class=""/>
</bag>
One customer in the db has about 30.000 items. I get an "OutOfMemory-Exception" when i try to invoke the following code
Code:
customer1.getItems().delete(item1); // takes ages and ends in an OutOfMemeory exception
I changed already from a set/Set to a bag/List in my mapping /Pojo to get better performace when adding a new Item
Code:
cusotmer1.getItems().add(item1); // is now very fast
Is there any possibility to get this fast performace out of hibernate when deleting an item????? I don't want to fetch all items into memory before deleting them!