c# - NHibernate collections: many-to-many relationships -


I have two models, a product model and a shopping cart model, in the shoppingcart model, as the property named Products There is a collection of products. Here's the mapping for my shoppingcart model.

  & lt; Class name = "MyProject.ShoppingCart, MyProject" table = "ShoppingCarts" & gt; & Lt; Id name = "id" column = "id" & gt; & Lt; Generator class = "parent" /> & Lt; / Id & gt; & Lt; Many-to-one name = "company" class = "MyProject.Company, MyProject" column = "CompanyId" /> & Lt; Property Name = "ExternalID" column = "GUID" generated = "Insert" /> & lt; Property Name = "Name" column = "Name" /> & Lt; Property Name = "Total" column = "total" /> & Lt; Property Name = "Creation Date" column = "Creation Date" generated = "Insert" /> & Lt; Property Name = "Update Date" column = "Update Date" generated = "Always" /> & Lt; Bag name = "product" table = "shoppingcontent content" lazy = "wrong" & gt; & Lt; Key column = "ShoppingCartId" /> & Lt; Many-to-many columns = "product ID" class = "MyProxyMyProject.product, MOEO project" fetch = "join" /> & Lt; / Bag & gt; & Lt; / Square & gt;  

When I try to save DB, shoppingcards are saved, but shoppingcart is not saving mapping rows in contracts, making me a point that there is a problem with mapping . Where am I going wrong?

Changes in the transaction should be increased, otherwise the nibernate will not save changes in the archive

< / Div>

Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -