Hello,
I still don't understand.

this means that a ShopTransaction is composed by a ShopTransaction and a Transaction database entries. Because of the flag auto-delete="true" what you are experiencing is absolutely normal.
Also you have 2 entries in different tables for one ShopTransaction instance, deleting the ShopTransaction will remove the entries in the 2 tables.

Is exactly what I want! When is deleted the record with transaction_id = 2041 in table ShopTransaction, the delete action should be propagated to table Transaction, but in my log I've 2 delete: a delete on table ShopTransaction with transaction_id = 2022 and a delete in table Transaction_id=2042


>>> transaction = new ShopTransaction();
>>> transaction.setTransaction_id(transaction_id);
>>> Criteria crit = new Criteria();
>>> crit.addEqualTo("transaction_id", new Integer(transaction_id));
>>> Query query = QueryFactory.newQuery(ShopTransaction.class,crit);


1. you should declare transaction as local method variable and not use a class variable
2. you do not need to generate a query (you don't do anything with it anyways in this piece of code)


when deleting an instance (and the primary key is set) OJB should manage to delete the correct object even if it has not been completely materialised, so you do not need to do any query.

1. I've seen this example in the tutorial. I don't understand how this can make the difference.
2. How can I get and delete a ShopTransaction (and Transaction) with a specified transaction_id without instantiate a new ShopTransaction ?


Thank you





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to