You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by "Boulay, Serge" <Se...@qunara.com> on 2002/12/17 23:33:18 UTC

collection delete/update

Will this work with odmg api
 
public void update (Order order) {
 
 tx = odmg.newTransaction();
 tx.begin();
 
Order aOrder = getOrder(order.getId());
 
// lock order for update
tx.lock(aOrder, Transaction.WRITE);
 
// Update Order name
aOrder.setName("Whatever");
 
// Update Collection
aOrder.setOrderItems(order.getOrderItems);
 
tx.commit
 
}
 
 
The only thing that updates is the order name , nothing happens with the collection  . What I would like to happen with the collection is 
that if 3 items currently exist and I reset the vector with a vector that contains 2 items ojb will delete the additonal item .
 
Mappings are all set to false
auto-retrieve="true"
auto-update="false"
auto-delete="false"
 
Serge