I have created a mapping file like this.
<?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="true"> <class name="AIMSObjects.EntityClasses.OrderHeader, AIMSObjects" table="orderHdr" optimistic-lock="version" dynamic-update="true" > <id name="FrndOrder" column="`order`" unsaved-value="-1"> <generator class="assigned"></generator> </id> <!--Order line list one to many mapping on orderlines --> <set name="OrderLines" table="orderln" lazy="true" inverse="true" cascade="all-delete-orphan" generic="true" access="field.camelcase-underscore"> <key column ="`ORDER`" foreign-key="`order`"></key> <one-to-many class ="AIMSObjects.EntityClasses.OrderLine, AIMSObjects"/> </set> </class > </hibernate-mapping >
while i am saving the entity as me.save(OrderEntity,Permission) it throughs the error " Found shared references to a collection in "AIMSObjects.EntityClasses.OrderHeader.orderlines"
Please provide me the solution for this.
my requirement is to copy an entity and create a new entity in the database with same values
i am doing as below
Dim objDistributionOrder As New OrderHeader objDistributionOrder = objOrderHeader.Clone() and after while saving data it give me the error
|