-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Found shared reference to a collection
PostPosted: Wed Sep 07, 2011 6:20 am 
Newbie

Joined: Wed Sep 07, 2011 6:14 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.