Thanks a lot Ajith!
I would like to make my question a bit more clear.
I have a parent class, say Purchase, and a purchase has many cheques associated with it. So Purchase has One-To-Many relation ship with Cheque and since it is bidirectional, Cheque has Many-To-One relationship with Purchase. In the queries given below "parent" refers to "Purchase" and child refers to "Cheque".
Case 1: I have the following queries to make 1. Update some fields in Parent 2. Insert new child records. 3. Delete some child records. 4. Update some child records.
In this case do I have to run separate queries for each step or Can One-To-Many side control all operations?
Case 2: In this I have queries 2, 3, 4 mentioned in the above case,that means there is no parent row update. What would be the best practice to do the operations?
Case 3: In this case I have only one child record to insert. What would be the best practice to insert the one child row?
Could anybody help me?
|