I've completed the mapping,config and pojos everything looks fine untill i try to save datas into the table, but then when i run the createQuery and try to retrieve datas back from the table it for some reason updates record from the primary table and deletes records from the other table mapped to it.
The table structure, primary table mapped to another table which has all columns in a list of the primary table, like
the class has one of the variables declared of type abc, and that variable is put in a list xyz. i believe the mapping is not right for the list,
<hibernate-mapping>
<class name="classA" table="Tbl_A">
<id name="Id" column="ID"/>
<property name="userName" column="USER_NAME"/>
<property name="TrackCode" column="TRACK"/>
<list name="xyz" table="Tbl_L" cascade="all">
<key column="ID"/>
<index column="IND"/>
<composite-element class="abc">
<property name="custName" column="Name"/>
<property name="custNumber" column="Number"/>
</composite-element>
</list>
</class>
</hibernate-mapping>
when tried retrieving it gets me the values userName and TrackCode but the datas from the list xyz are lost, please give me ur suggestion, greatly appreciate if at the earliest. Thanks.
|