[Bug #964] Impossible to delete materials not assigned to an order element

FEA: ItEr74S04BugFixing
This commit is contained in:
Diego Pino Garcia 2011-04-05 12:47:43 +02:00
parent a275a03e09
commit 36cbb9f650
2 changed files with 3 additions and 2 deletions

View file

@ -146,6 +146,7 @@ public class MaterialCategory extends IntegrationEntity {
}
public void removeMaterial(Material material) {
material.setCategory(null);
materials.remove(material);
}

View file

@ -80,7 +80,7 @@
index="idx_material_category_on_parent"/>
<!-- Indexed the other side -->
<set name="materials" inverse="true" cascade="all">
<set name="materials" inverse="true" cascade="all-delete-orphan">
<key column="category_id"/>
<one-to-many class="Material"/>
</set>
@ -140,4 +140,4 @@
</class>
</hibernate-mapping>
</hibernate-mapping>