-->
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: Problem in saving Parent sequence column.......
PostPosted: Mon Jul 11, 2011 3:00 am 
Newbie

Joined: Tue May 10, 2011 8:22 am
Posts: 4
Hi all,
I am trying to insert the data in Parent and Child tables.
My HBMs for Parent and child are as follows:



DMSMasterDO-> Parent
DMSDetailDO-> Child



<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class
name="com.master.DMSMasterDO" table="DMSMASTER">
<id name="id" type="java.lang.Long">
<column name="DMSMASTERSEQ" />
<generator class="native">
<param name="sequence">SEQ_DMSMASTER</param>
<param name="max_lo">100</param>
</generator>
</id>

<property name="definitionCd" type="java.lang.String">
<column name="DEFINITIONCD" />
</property>
<property name="description" type="java.lang.String">
<column name="DESCRIPTION" />
</property>

....
....

<bag name="listDmsDetailList" cascade="all-delete-orphan" lazy="false" inverse="true">
<key column="DMSMASTERSEQ" />
<one-to-many class="com.master.DMSDetailDO"/>
</bag>
</class>
</hibernate-mapping>






<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class
name="com.master.DMSDetailDO" table="DMSDETAIL">
<id name="id" type="java.lang.Long">
<column name="DMSDETAILSEQ" />
<generator class="native">
<param name="sequence">SEQ_DMSDETAIL</param>
<param name="max_lo">100</param>
</generator>
</id>
<version name="versionID" column="versionid" type="java.lang.Long"></version>
<property name="guid" type="java.lang.String">
<column name="guid" not-null="true" />
</property>
<property name="kpiCd" type="java.lang.String">
<column name="KPICD" />
</property>
<property name="rate" type="java.lang.Double">
<column name="RATE" />
</property>
....
....

<many-to-one name="parentGuidObj" class="com.master.DMSMasterDO" not-null="true">
<column name="DMSMASTERSEQ" />
</many-to-one>

</class>
</hibernate-mapping>


Here is the problem->

while trying to save into DMSDetailDO(Child) via DMSMasterDO(Parent)

I am getting the null value in DMSMASTERSEQ column of Child table.

I will be very thankful if anyone know the basic problem behind this.....


regads:
Rakesh G.


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.