hello,
I have a POJO which contains a Set:
Code:
public class GeOutage implements java.io.Serializable {
private Set geOutageComponents;
}
When I am trying to remove an item from the POJO's set and store it to the database again, the changes are not updated. My outage-POJO is clearly updated, though...
Code:
GeOutage outage = (GeOutage)session.load(GeOutage.class, id);
Set outageComponents = outage.getGeOutageComponents();
outageComponents.remove(outageComponentToRemove);
Transaction transaction = session.beginTransaction();
session.saveOrUpdate(outage);
transaction.commit();
I guess this is basic Hibernate knowledge, but I just don't seem to get it... Why is my POJO updated, but the database not? My GeOutage.hbm.xml has the following setting:
Code:
<set name="geOutageComponents" lazy="true" inverse="true" cascade="all">
<key>
<column name="GEO_ID" />
</key>
<one-to-many class="GeOutageComponent"/>
</set>
Any help would be highly appreciated.
cheers,
Kenny