> The example I gave was a Customer and a Product.  The Customer has a
> collection of Products, the relation of which is maintained in say a
> CUSTOMER_PRODUCT table.  Because it is "non-decomposed", I do not create a
> CustomerProduct class.  Now in client code, I do:
>
> Customer customer = // lookup customer
> Product firstProduct = // lookup Product #1
> Product secondProduct = // lookup Product #2
> customer.getProducts().add( firstProduct );
> customer.getProducts().add( secondProduct );
> pb.store( customer );
>
>
> Later, account receivable realizes they made a mistake, so:
> Customer customer = // lookup customer
> Product secondProduct = // lookup Product #2
> Product thirdProduct = // lookup Product #3
> customer.getProducts().remove( secondProduct );
> customer.getProducts().add( thirdProduct );
> pb.store( customer );

>From my expenience with PB, you will get the firstProduct and the
thirdProduct in the cache, but your db will still have all the 3 products.
Once you clear the cache, you'll see 3 again!

Seems that store() only does insert and update queries. It would be perfect
if it does delete queries, by comparing the graphs of the old cache and the
new object, before its update


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

Reply via email to