nhibernate - fluent nhibarnate doesn't delete orpahns -
i found similar threads got code answer.
i using one-to-many relationship.
father mapping:
hasmany(x => x.targetings).keycolumn("fk_campaign_id").cascade.alldeleteorphan().inverse().asbag();
and child :
references(x => x.nhcampaign).column("fk_campaign_id");
where father has list of child. working - inserting , updating. reason when empty list in father or want delete list item, doesn't delete child database. if list empty.
this how update:
using (isession session = nhibernatehelper.opensession()) { using (itransaction transaction = session.begintransaction()) { session.update(fatherobject); //session.saveorupdate(ocampaign); transaction.commit(); } }
am doing wrong here?
got using not.lazyload()
method.
Comments
Post a Comment