Many to Many relationship, without Joining table

Topics: General, Writing modules
Jul 15, 2013 at 3:19 AM
Hi all,

Is it possible to define Many-to-Many relationship in Orchard, as following, without introducing any Joining Class (http://docs.orchardproject.net/Documentation/Creating-1-n-and-n-n-relations).
<class name="NHibernate.Auction.Category, NHibernate.Auction">
    <id name="Id" column="ID"/>
    ...
    <bag name="Items" table="CATEGORY_ITEM" lazy="true">
        <key column="CATEGORY_ID"/>
        <many-to-many class="NHibernate.Auction.Item, NHibernate.Auction" column="ITEM_ID"/>
    </bag>
</class>

<class name="NHibernate.Auction.Item, NHibernate.Auction">
    <id name="id" column="ID"/>
    ...

    <!-- inverse end -->
    <bag name="categories" table="CATEGORY_ITEM" inverse="true" lazy="true">
        <key column="ITEM_ID"/>
        <many-to-many class="NHibernate.Auction.Category, NHibernate.Auction" column="CATEGORY_ID"/>
    </bag>
</class>
Thanks.

Regards,
Tien Huat
Jul 15, 2013 at 3:20 AM
Sorry, the Subject should be "Many to Many relationship, without Joining Class"
Jul 16, 2013 at 8:18 AM
I had the same issue. but then i realized that i can live with the extra class. :)