-->
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: XMLMapping and composite-id
PostPosted: Sun May 07, 2006 3:08 pm 
Beginner
Beginner

Joined: Sun May 07, 2006 2:44 pm
Posts: 33
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

[b]Hibernate version:[/last version (3)]

I have the following mapping :
<hibernate-mapping>
<class name="B" table="business_rules" node="B">
<composite-id name="id" class="hibernate.model.BusinessRulesPK">
<key-property name="brsid" column="BRS_ID" type="long" node="@id"/>
<key-many-to-one name="A" column="qid" class="hibernate.model.QueryEvents" />
</composite-id>
</class>
</hibernate-mapping>


As you can see the "B" obj has relation many to one to "A" obj.

The Xml look like this :
<A qid="1">
<busines_rules>
<B id="3" name="" recipe_name=""/>
</busines_rules>
</A>

I got the following error:
ids for this class must be manually assigned before calling save(): hibernate.model.B

I saw that there was already bug for composite-id(HHH-248), but this is not the same issue.

Please . Please Please Please Please Please Please Please Please Please

Does any body know how to define the Xml mapping in oder that the id will be taken from the "id" node and the second part lof the composite-id will be taken from "A" obj



Thank you very much.

You are great


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.