You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by Antonio Gallardo <ag...@agsoftware.dnsalias.com> on 2003/12/06 19:32:11 UTC

Re: [Bug?] PBImpl delete of 1:n relation when auto-delete is set true

Hi Armin:

The exposed behavior works well to me. The only diference I have is that
in O/R mapping we don't use the "auto-retrieve" attribute at all.

Best Regards,

Antonio Gallardo

Armin Waibel dijo:
> Hi all,
>
> I think I found a bug? in PBImpl class on delete of the 1:n relations of
> the main object when auto-delete is set true in metadata.
>
> Say we have a Product class and a Component class, Product has a 1:n
> relation to Component and we set auto-delete in collection-descriptor.
>
> Product
> {
> id
> name
> components
> }
>
> Component
> {
> id
> name
> productId
> }
>
> 1. auto-retrieve is set true and we query a Product, then we get all
> Components from Product and remove some components (or set components
> 'null'). After this we delete this Product instance ---> auto-delete is
> true, thus all found components will be deleted (without the removed)
> BUT we should delete all components associated with this Product instance.
>
> 2. auto-retrieve is set false. Get a Product and delete it. Since we set
> auto-delete true we expect that all associated Components will be
> deleted too.
>
> Or do I misinterpret the 'auto-delete' flag?
>
> regards,
> Armin
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Re: [Bug?] PBImpl delete of 1:n relation when auto-delete is set true

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Antonio Gallardo dijo:
> Hi Armin:
>
> The exposed behavior works well to me. The only diference I have is that
> in O/R mapping we don't use the "auto-retrieve" attribute at all.
>
> Best Regards,
>
> Antonio Gallardo

Sorry, I review it again:

Since we don't set auto-retrieve attribute, then it is true by default.
Note we also use auto-update="true" to get the behavior you exposed below.

I hope this would help.

Best Regards,

Antonio Gallardo

>
> Armin Waibel dijo:
>> Hi all,
>>
>> I think I found a bug? in PBImpl class on delete of the 1:n relations of
>> the main object when auto-delete is set true in metadata.
>>
>> Say we have a Product class and a Component class, Product has a 1:n
>> relation to Component and we set auto-delete in collection-descriptor.
>>
>> Product
>> {
>> id
>> name
>> components
>> }
>>
>> Component
>> {
>> id
>> name
>> productId
>> }
>>
>> 1. auto-retrieve is set true and we query a Product, then we get all
>> Components from Product and remove some components (or set components
>> 'null'). After this we delete this Product instance ---> auto-delete is
>> true, thus all found components will be deleted (without the removed)
>> BUT we should delete all components associated with this Product
>> instance.
>>
>> 2. auto-retrieve is set false. Get a Product and delete it. Since we set
>> auto-delete true we expect that all associated Components will be
>> deleted too.
>>
>> Or do I misinterpret the 'auto-delete' flag?
>>
>> regards,
>> Armin
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
>> For additional commands, e-mail: ojb-dev-help@db.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org