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.