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
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to