I guess this should help you.
class A
{
ISet<B> X;
}
class B
{
ISet<A> Y;
}
A.hbm.xml
<set name="X" table="XXX" generic="true" where="if you have any not null
checks here, go for it." inverse="true or false" lazy="true">
<key column="B_ID"/>
<many-to-many class="B, DLL" column="B_ID" not-found="ignore"/>
</set>
B.hbm.xml
<set name="Y" table="YYY" generic="true" where="if you have any not null
checks here, go for it." inverse="true or false" lazy="true">
<key column="A_ID" />
<many-to-many class="A, DLL" column="A_ID" not-found="ignore" />
</set>
Also refer these manuals.
https://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/
https://www.hibernate.org/hib_docs/nhibernate/1.2/reference/en/html/mapping.html
For a many to many association where items can be duplicates, you should be
using a *bag* on both mapping files. A bag is unordered and unindexed, where
as a set is unique.
I would also strongly suggest www.summerofnhibernate.com
Socratees.
2010/3/3 Everton Lucas <[email protected]>
> Hi People
>
> I need to know how can I implement classes and hbm files demonstrated in
> the uml diagram attached. I really don't know if there is a way to implement
> that without IList and bag tag.
>
> Thanks in advance
> Everton Lucas
>
> --
> 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]<nhusers%[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.