Looks better than a delete parameter.

What do you mean with sync? Synchronized method?

Regards Johannes

Am 26.01.2015 um 22:23 schrieb Andrus Adamchik:
> 
>> On Jan 26, 2015, at 1:47 PM, Johannes <[email protected]> wrote:
> 
>> My motivation for introducing the delete parameter was, that your are
>> not able to the treat orphaned objects with a delete rule. Please
>> correct me, if its wrong. The delete rule is called only, if you trigger
>> .delete(). If you just remove your relationship: no entity will be
>> deleted. I guess this is the deletion question Michael Gentry was
>> talking about.
> 
> Good point about delete rules. You are absolutely right and I stand 
> corrected. Perhaps one other way to deal with deletions, is to return a 
> collection of removed objects from the method, leaving it up to the caller to 
> deal with them:
> 
> // sync...
> List<? extends DataObject> removed = 
> o.setToManyTarget(Artist.PAINTINGS.getName(), newPaintings, true); 
> 
> // delete ... or not
> // o.getObjectContext().deleteObjects(removed); 
> 
> Andrus
> 
> 
> 
> 
> 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to