sunilkumarsh wrote:
hey thanks for replying so fast but be very gratefull if get working answer from u
I am copying the mapping file
this is parent in which child is mapped
<!-- Children -->
<set name="machineAssignments" inverse="true" cascade="save-update">
<!-- Meta data -->
<meta attribute="scope-set">private</meta>
<meta attribute="gen-one-to-many">true</meta>
<meta attribute="default-value">new HashSet()</meta>
<key column="prc_id"/>
<one-to-many class="com.tpgmail.spp.model.MachineAssignment"/>
</set>
This is child in which parent is mapped
<!-- Parents -->
<many-to-one name="sortingList"
class="com.tpgmail.spp.model.SortingList"
cascade="none"
outer-join="auto"
column="run_id"
foreign-key="spp_mas_run_fk"
index="spp_mas_run_fk_ind"
not-null="true" />
<many-to-one name="productionCapacity"
class="com.tpgmail.spp.model.ProductionCapacity"
cascade="none"
outer-join="auto"
column="prc_id"
foreign-key="spp_mas_prc_fk"
index="spp_mas_prc_fk_ind"
not-null="true" />
Now we have made 2 method
first to get the child this will return the list of child ID.
I will put this in loop ..load the id and delete it.
After this we will load the parent and simply delete it.
Thats it.
But unfortunately its giving me error
:(
I'd really like to help you here but there's a reason they post this at the top.
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: