Hi!

I have a problem with the many-to-many relationship.

I have one user class and one product class and then the relational
databasetable users_products.

I mapped the user class like this:

<bag name="Products" table="users_products" cascade="none"
lazy="true">
      <cache usage="read-write" />
      <key column="UserId" />
      <many-to-many class="Collection.DAL.Domain.Product.Prod,
Collection.DAL" column="ProductId" outer-join="true" />
 </bag>

And the product class like this:
 <bag name="Users" table="users_products"" cascade="none" lazy="true"
inverse="true">
      <cache usage="read-write" />
      <key column="ProductId" />
      <many-to-many class="Collection.DAL.Domain.People.User,
Collection.DAL" column="UserId" outer-join="true" />
    </bag>

I have the problem that if i delete a user the product gets deleted
to.
I want this function... if i delete the user then the products that
belongs to the user in the relational databasetable "users_products"
should be removed and then the user should been deleted.

The table users_products have a pk UserProductId and then UserId and
ProductId.

How can i do this?

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