Hello Gareth,

On 27 Jan, 02:00, Gareth Hayter <[email protected]> wrote:
> Is there a way to implement a many-to-many relationship in NHibernate that
> has two association tables?
>
> Normal many-to-many:  
> Database: TableA  1:m  AssociationTable  m:1  TableB
> NH: EntityA  m:m  EntityB
>
> What I'm wondering about:
> Database:  TableA  1:m  AssociationTableA  1:m  AssociationTableB  m:1
>  TableB
>
> In this instance, is it possible to map the entity for TableA to th entity
> for TableB?

I am not sure this is exactly what you are looking for, but I did
something similar recently. In my case I needed a many-to-many
relationship between classes of the same type. A self-join with many-
to-many. So far I haven't been able to figure out how to solve this
with only one association table, so I am using two. Have a look at my
mapping: 
https://github.com/dlidstrom/GridBook/blob/master/GridBook/Mapping/BoardMap.cs

Good luck!

Daniel

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

Reply via email to