Hi Johannes, I'm not aware of one built into Cayenne that does this yet. I know I've had to write similar functionality a couple times in the past, too.
mrg On Sat, Dec 13, 2014 at 1:41 AM, Johannes <[email protected]> wrote: > > try again > > > -------- Weitergeleitete Nachricht -------- > Betreff: a setter for addToManyTarget ? > Datum: Sat, 13 Dec 2014 07:36:55 +0100 > Von: Johannes <[email protected]> > An: cayenne >> [email protected] > > Hello, > > my object model has 2 toMany relationships. Cayenne Modeler generated > next to addToManyTarget(String, DataObject, boolean) methods like > addToCategories(Category) or addToTags(Tag) for me. Fine. > > In some use cases it would be wonderful to call a method like > *setCategories(List<Category>)*, which would add only new and remove > only missing Categories. Existing Categories aren't touch of course. > > This would save much work, because the setter is written by me multiple > times in different projects. > Or does such a method exist today? > > Best regards Johannes > > > > > >
