And if I use some attribute to map this kind of relationship?

*like:*
class Company
  string Name
  [ManyToMany(TableName="PersonCompany"])
  IList<Person> Persons

I see it in this
post<http://stackoverflow.com/questions/6822430/fluent-nhibernate-mapping-hasmanytomany-by-convention/12198533#12198533>,
but I failed to implement.

I need a way (convention or not) to perform this task.




On Wed, May 22, 2013 at 10:51 AM, Carl Bussema <carl.buss...@gmail.com>wrote:

> I don't think you can. You either need a bidirectional association or a
> classmap or an override. I wouldn't want to have a convention deciding
> which relationships were 1:N and which where N:M... you can read it from
> the Domain model or you can spell it out if you're not using bidirectional
> associations. You can write an override mapping that just spells out the
> mapping details you can't get from convention, or where you want to change
> the convention.
>
> I could be wrong about whether it's possible, but you have to ask at what
> point you're relying too much on conventions.
>
>
> On Wed, May 22, 2013 at 9:37 AM, Riderman Sousa <
> riderma...@bindsolution.com> wrote:
>
>> How to do In many to many relationship, where no child class.
>>  How to generate a table by convention linking the two?
>>
>> *Tables to be generate:*
>> table Person
>>   Id
>>   Name
>>
>> table Company
>>   Id
>>   Name
>>
>> table PersonCompany
>>   PersonId
>>   CompanyId
>>
>> *Current class*
>> class Person
>>   string Name
>>
>> class Company
>>   string Name
>>   IList<Person> Persons
>>
>> As you can see, there are no IList<Company> child property on class
>> Person.
>> How to generate a second table (PersonCompany) by convention in this
>> case?
>>
>> Riderman de Sousa Barbosa <http://about.me/ridermansb>
>>
>> Web Developer | MCPD Certify
>>
>> Skype.: 4042-6002 | Cel.: (31) 8681-1986
>> bindsolution.com
>>
>> Microsoft Parner Network
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Fluent NHibernate" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to fluent-nhibernate+unsubscr...@googlegroups.com.
>> To post to this group, send email to fluent-nhibernate@googlegroups.com.
>> Visit this group at
>> http://groups.google.com/group/fluent-nhibernate?hl=en-US.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Fluent NHibernate" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to fluent-nhibernate+unsubscr...@googlegroups.com.
> To post to this group, send email to fluent-nhibernate@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/fluent-nhibernate?hl=en-US.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fluent-nhibernate+unsubscr...@googlegroups.com.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
Visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to