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.
|
|