[RDBO] Appending new object in one-to-many relation

2006-04-13 Thread Svilen Ivanov
Hi - I've noticed weird behavior when dealing with one-to-many relation. I'll use tutorial objects Product - Vendor to describe it. You can get all products for given vendor by calling $vendor-products. I want to add one more product for this vendor, so I do (pseudo-code): my @products =

Re: [RDBO] Appending new object in one-to-many relation

2006-04-13 Thread John Siracusa
After digging a little bit, I saw that when updating vendor, it first deletes all products for this vendor and tries to add the new ones. So far, so good. But all the objects retrieved using products() method are in state in_db which means that they will be updated (using SQL UPDATE) instead

Re: [RDBO] Appending new object in one-to-many relation

2006-04-13 Thread Svilen Ivanov
2006/4/13, John Siracusa [EMAIL PROTECTED]: [...] Also I understood that my approach isn't very effective so I'll use the many-to-one relation of Product object in order to add one more product for given vendor: my $product = Product-new; $product-vendor($vendor); # $vendor ISA