-->
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: collection is not associated with any session.
PostPosted: Mon Jun 29, 2009 5:02 am 
Newbie

Joined: Thu May 14, 2009 4:19 am
Posts: 12
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" >
<class name="StaticData.Product, StaticDataLibrary" table="tbl_EspadaProduct" lazy="false">
<id name="Id" column="Id" type="string">
<generator class="assigned" />
</id>
<property name="MarketId" column="MarketIdFk" />
<property name="DisplayName" column="DisplayName" />
<property name="SubMarket" column="SubMarket" />
<bag name="OrderTypes" table="tbl_EspadaSyntheticProductTypeLnk" lazy="false" >
<key column="Type" property-ref="SubMarket"/>
<many-to-many class="StaticData.OrderType, StaticDataLibrary" column="ProductType" lazy="false"></many-to-many>
</bag>

</class>
</hibernate-mapping>

which causes a collection is not associated with any session.
However changing property-ref to foreign-key prevent the error, but generates the wrong sql. Id is used as the parameter rather than SubMarket.

Thanks
Rakesh


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.