cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes <jo...@posteo.de>
Subject setter for toMany in generated classes
Date Sat, 05 Dec 2015 15:19:41 GMT
Dear list,

I want to bring back my idea from February into discussion. It was about
introducing a setToManyTarget Method in the CayenneDataObject, but it
was not finished (mail archive:
http://mail-archives.apache.org/mod_mbox/cayenne-dev/201501.mbox/%3C0DBA750D-A847-4CC1-8EAC-9DCFB5A0FECA%
40objectstyle.org%3E )


My last action was, implementing Andrus advice to retrieve old
DataObjects, which can be deleted manually:

// sync...
List<? extends DataObject> removed =
o.setToManyTarget(Artist.PAINTINGS.getName(), newPaintings,
true);

// delete ... or not
// o.getObjectContext().deleteObjects(removed);


This was implemented immediatly by myself with following commit, but I
forgot to mention it on the list:
It was implemented in
https://github.com/jotpe/cayenne/commit/b930886a9ab24fa8b82a7e8efeaf6d2437bd5d96


Best Regards.
Johannes


Mime
View raw message