Ahmed, I don't think there's a single "best practice" here. It all depends on your usage.
Diego On Wed, Jun 16, 2010 at 11:34, Ahmed Emad <[email protected]> wrote: > hi all, > > i know that we can choose cascading option for collections or for any > association type in Nhibernate > > but in case of bidirectional association is it better to choose cascading > opi\tion for both 2 directions. and if it is better , are there prefered > Suitable options? > > for example : > i have 2 classes person and job with one - many association from person to > job > > In Job====> > <many-to-one name="Person" class="Person" cascade="save-update" > > <column name="PersonId" /> > </many-to-one> > > In Person===> > > <bag name="Jobs" lazy="true" inverse="true" cascade="save-update"> > <key> > <column name="Id" /> > </key> > <one-to-many class="Job" /> > </bag> > > does it better to determine cascding that marked red? > or i should put cascading only for collection end of association > > and what is the case in one-one association? > > Note : my questions not about does it work , how to work better > > thx in advance > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
