Delete element from Set
Posted
by Blitzkr1eg
on Stack Overflow
See other posts from Stack Overflow
or by Blitzkr1eg
Published on 2010-04-11T11:45:30Z
Indexed on
2010/04/11
11:53 UTC
Read the original article
Hit count: 302
Hi. I have 2 classes Tema(Homework) and Disciplina (course), where a Course has a Set of homeworks. In Hibernate i have mapped this to a one-to-many associations like this:
<class name="model.Disciplina" table="devgar_scoala.discipline" >
<id name="id" >
<generator class="increment"/>
</id>
<set name="listaTeme" table="devgar_scoala.teme">
<key column="Discipline_id" not-null="true" ></key>
<one-to-many class="model.Tema" ></one-to-many>
</set>
</class>
<class name="model.Tema" table="devgar_scoala.teme" >
<id name="id">
<generator class="increment" />
</id>
<property name="titlu" type="string" />
<property name="cerinta" type="binary">
<column name="cerinta" sql-type="blob" />
</property>
</class>
The problem is that it will add (insert rows in the table 'Teme') but it won't delete any rows and i get no exceptions thrown.
Im using the merge() method.
© Stack Overflow or respective owner