Hi
I've got an Offer (parent object) which contains a collection of Conditions. I'm using a bag, defined as follows:
Code:
<bag name="conditions" table="MORTGAGE_OFFER_CONDITION" lazy="true">
<key column="OFFER_ID"/>
<many-to-many class="com.lsb.uk.mqs.value.ConditionValue"
column="CONDITION_ID"/>
</bag>
When I delete an element from a JUnit test, which calls the DAO method directly, it works fine.
But, when called by the system this lives in (via a BO layer, which is where the transaction level is set) a call to .remove() on the collection, makes no difference, even if I flush the session.
This is the method code:
Code:
public void deleteMortgageOfferCondition(int offerId, int conditionId) {
OfferValue offer = (OfferValue)getHibernateTemplate().load(OfferValue.class, new Integer(offerId));
ConditionValue cond = (ConditionValue)getHibernateTemplate().load(ConditionValue.class, new Integer(conditionId));
offer.getConditions().remove(cond);
getHibernateTemplate().update(offer);
};
Anyone know why it's not working? PS the update() call at the end doesn't make any difference either.
Thanks
Richard