Joined: Thu Oct 25, 2007 11:38 pm Posts: 1
|
We are facing a strange issue while deleting a row in a table.
We have 3 tables. Parent and child 1 and child 2
Child 1 & 2 have multiple entries of parents.
Here parent table - game table.
child 1 - clips (audio and video) belong to the game
child 2 - discussion related to the game table.
So the child 1 & child 2 are linked with the parent table by using the primary key of parent table (game table) as a foreign key.
So when deleting the entries in the parent table ( deleting a game in the game table), the no of queries fired in the child table is directly proportional to the number of entries in the child table.
We used the cascadedelete mapping the hibernate as follows
<set name="gameClips" inverse="true" cascade="delete-orphan">
<key column="game_ID" />
<one-to-many class="SPGameClip" />
</set>
So please help us to solve this issue
|
|