In my opinion, conversation is more general and high level than automapping alteration. It's defferent with fluent mapping.
when I choose auto mapping, it means I don't want to write mappings, If I want to alter some in general, I create some conversations for all entities. but because auto mapping is not smart enough now, I have to alter some detail mapping for some entity, i.e. many-to-many table name. So I think the priority of automapping alteration should be higher than conversion. When I choose fluent mapping, it means I always write my own mappings, but I still want alter some in general, I write conversation, so on this sceniar, conversation should override my fluent-mapping. On Thu, Apr 2, 2009 at 4:35 PM, James Gregory <[email protected]>wrote: > > Not possible. If you were to create a HasManyToMany covention, how > would it be applied to the HasManyToMany from your override if the > conventions were run first? > > Overrides can alter the mapping, so conventions have to be applied > last to accomodate for those potential changes. > > On 4/2/09, Karron Qiu <[email protected]> wrote: > > I knew what is the problem. Because I wrote a HasManyToManyConversation > that > > set the table name, it overrided the EmployeeMap and TerritoryMap. I > think > > this behavor is not correct, the priority of IAutoMappingOverride should > > higher than the conversation. > > > > On Thu, Apr 2, 2009 at 2:59 PM, Karron Qiu <[email protected]> wrote: > > > >> I tried IAutoMappingOverride, but very strange, it doesn't work. > >> > >> here are my mappings. I specified a table name for the relationship > table. > >> but fluent nhibernate still generated two tables for me. > >> > >> public class EmployeeMap : IAutoMappingOverride<Employee> > >> { > >> public void Override(AutoMap<Employee> mapping) > >> { > >> mapping.HasManyToMany(e => e.Territories) > >> .WithTableName("EmployeesToTerritories"); > >> } > >> } > >> > >> public class TerritoryMap : IAutoMappingOverride<Territory> > >> { > >> public void Override(AutoMap<Territory> mapping) > >> { > >> mapping.HasManyToMany(t => t.Employees) > >> .WithTableName("EmployeesToTerritories") > >> .Inverse(); > >> > >> } > >> } > >> > >> > >> On Thu, Apr 2, 2009 at 2:33 PM, Karron Qiu <[email protected]> wrote: > >> > >>> It seems this > >>> issue<http://code.google.com/p/fluent-nhibernate/issues/detail?id=159 > >is > >>> still not fixed. Is there any good solution to solve or avoid this > >>> problem? > >>> > >>> Thank you very much. > >>> > >>> -- > >>> Regards, > >>> Karron > >>> > >> > >> > >> > >> -- > >> Regards, > >> Karron > >> > > > > > > > > -- > > Regards, > > Karron > > > > > > > > > > > -- Regards, Karron --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" 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/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---
