Hello Rahul,

> Well I could not understand what you actually mean to say by this
> 
> " This works only, if there are no depedencies to the child table and if you 
> don't have to log the changes "

This refers to the use of DELETE during the UPDATE only. If there is a
third table with

FOREIGN KEY (orderitemid)
REFERENCES orderitem(id)
ON DELETE RESTRICT (respectively CASCADE)

the

DELETE FROM orderitem
WHERE orderid = #value#

could cause a FOREIGN KEY violation respectively the deletion of some
rows in the third table. In your case this seems irrelevant.

>> sqlMapClient.delete("Order.deleteDetails", order);
> 
> This works only, if there are no depedencies to the child table and if
> you don't have to log the changes.
> 
>> for (int i=0;i<order.getOrderItems().size();i++) {
>> OrderItem oi = (OrderItem) order.getOrderItems().get(i);
>> oi.setOrderId(order.getOrderId());
>> sqlMapClient.insert("OrderItem.insert", oi);
>> }

Ingmar

Reply via email to