Hi guys, I am having the following exception "Creating a proxy instance failed (Ambiguous match found)", when i try to delete an object
Here is the mapping xml and the class definition, Actually I am using .net frm 4.0,
<?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <class name="Resto.Model.Entities.ProductType, Resto.Model" table="ProductType" lazy="true"> <id name="Id" column="Id" type="Int32" unsaved-value="0"> <generator class="identity"/> </id> <property column="Description" type="String" name="Description" length="100"/> <bag name="Childs" lazy="false" cascade="all" inverse="true"> <key column="ParentId" /> <one-to-many class="Resto.Model.Entities.ProductType, Resto.Model" /> </bag> <many-to-one name="Parent" class="Resto.Model.Entities.ProductType, Resto.Model" column="ParentId" not-null="false" /> </class> </hibernate-mapping>
public class ProductType : Identificable {
public ProductType() { } public ProductType(string description) { this.Description = description; } public virtual string Description { set; get; } public virtual ProductType Parent { set; get; } public virtual IList<ProductType> Childs { set; get; }
public virtual void AddChild(ProductType child) { child.Parent = this; this.Childs.Add(child); }
}
|