-->
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: One-to-many mapping issue - unable to update child table
PostPosted: Mon May 15, 2006 3:41 am 
Newbie

Joined: Mon May 15, 2006 1:39 am
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0

Mapping documents:
<!--Parent table -->
<set
name="linkedArticles"
lazy="false"
cascade="all"
sort="unsorted"
inverse="false">
<key column="ARTICLE_ID" ></key>
<one-to-many class="com.model.LinkedArticle" />
</set>

<!--Mapping table -->

<hibernate-mapping>
<class name="com.model.LinkedArticle" table="pcw_linked_article">
<composite-id>

<key-many-to-one name="article"
class="com.model.Article"
column="ARTICLE_ID">

</key-many-to-one>

<key-property name="linkedArticleId" column="LINKED_ARTICLE_ID" />

</composite-id>


<property
name="articleSequence"
column="LINKED_SEQUENCE"
type="java.lang.Integer"
update="true"
insert="true"
/>


<!--Need to do mapping-->
</class>
</hibernate-mapping>



Using the one-to-many mapping in parent table i can able to insert the records into my child table(which i need). but i cannot able to update the child table records.

But If i made the parent mapping like this :

<set
name="linkedArticles"
lazy="false"
cascade="all-delete-orphan"
sort="unsorted"
inverse="true">
<key column="ARTICLE_ID" ></key>
<one-to-many class="com.model.LinkedArticle" />
</set>

Its working fine..

I cannt able to understand the concept behind the "inverse" property.Can any one help me out.


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.