Thank you so much. It did work. On Thu, Mar 24, 2011 at 11:27 PM, Fabio Maulo <[email protected]> wrote:
> Sure. > After you have removed the NewsArticle from Project be 100% sure that your > domain look consistent in RAM (that mean that when you look into > NewsArticle.Projects > we have to not find the relation). > > When your domain is consistent in RAM you can be pretty sure that > NHibernate will maintain it consistent in the DB. > > On Thu, Mar 24, 2011 at 2:09 PM, agha.raza <[email protected]> wrote: > >> Hi All, >> >> Can someone please help me with this issue with the many-to-many >> mappings in fluent nhibernate 1.0? I have many to many relationship >> between two aggregate roots i.e. Projects and NewsArticles and am >> using AutoMapping to map the two. I have also defined >> HasManyToManyConvention for AutoPersistanceModelGenerator. Here are >> the overrides that I have for both entities: >> >> ProjectOverrides: >> >> mapping.HasManyToMany(c => >> >> c.FeaturedNewsArticles).Table("NewsArticleProject").Cascade.All().Inverse() >> >> >> NewsArticleOverrides: >> >> mapping.HasManyToMany(c => >> c.FeaturedProjects).Table("NewsArticleProject").Cascade.All(); >> >> This allows me to associate entities to eachother from both sides i.e. >> I can associate Projects to NewsArticles using NewsArticle object and >> I can associate NewsArticles to Projects using Project object. I want >> to also be able to remove the associations using both the objects but >> at the moment I can do it by NewsArticle object due to the inverse in >> the mapping. Is there any way I could delete the association using the >> Project object as well? Do I need to add something to mapping >> overrides here or do I need to take some different approach to solve >> this. >> >> Thanks, >> Agha >> >> -- >> 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. >> >> > > > -- > Fabio Maulo > > -- > 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. > -- 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.
