This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi All I've really been struggling for the last (literal) 24 hours on this issue. I'm very new to Nhibernate and thus have taken to the opinion that I don't know what I'm doing and need to learn from those who obviously do. A great way, I thought, to get to know some of the inner workings while being able to get off the ground fairly quickly was use to make use of a Visual ORM generator. But alas, I have encountered a problem very early in my learning experience: Designer Version: 2.1.329.20403 I have the following 3 tables in my database Dropping the 3 tables directly (drag-n-drop) into the Visual Designer, gives me the following 3 object entities. Beautiful! Although, when I attempt to now save an object of OrderLine to the database I get the infamous error:
After scouring the internet for hours and hours, I eventually came across a few users posts that said the error stemmed from a mapping issue whereby a property item(s) (in this case the OrderLine.ShoppingCartId, and OrderLine.SkuId), were each mapped twice in the xml mapping file. Firstly they were mapped as a property and a second time in a many-to-one relationship. Would you believe it, they were right, as the generated XML for OrderLine showed the following:
But I didn't believe it at first, as I thought: "I'm doing the most basic of examples here, surely the Generator cannot be wrong, so I scoured and scoured hoping to find somewhere where I had gone wrong, but I couldn't find it... For a downloadable example of the project I used above, please see Ivan's post on the following link: http://www.mindscapehq.com/forums/thread/329262. Really hoping someone can guide me in the right direction here as to where the problem truly lies... |
|