[Bug #964] Impossible to delete materials not assigned to an order element
FEA: ItEr74S04BugFixing
This commit is contained in:
parent
a275a03e09
commit
36cbb9f650
2 changed files with 3 additions and 2 deletions
|
|
@ -146,6 +146,7 @@ public class MaterialCategory extends IntegrationEntity {
|
|||
}
|
||||
|
||||
public void removeMaterial(Material material) {
|
||||
material.setCategory(null);
|
||||
materials.remove(material);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue