Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sadly I didn't get any feedback this time at developer mailinglist. But this shouldn't contain bug anyway.
This pull request serves a setter method for toManyTargets, which is located in the
CayenneDataObject
(thank Davids advice). Others and me desire such a functionality in the out-of-the-box class gernation, look at user mailinglist.In difference to
addToManyTarget
andremoveFromManyTarget
this method takes a inputCollection<? extends DataObject>
and an optionalboolean
delete parameter (default is false) for deletionof DataObjects, which relationships were removed.
The method documentation should be more comprehensible, what the method does and what not.
The
superclass.vm
generates two setter methods per toMany relationship where the relationName is part of the method name. The delete ommited method sets the deletion parameter to false and calls the other method.I don't know, if it is a the best idea to serve a deletion parameter to prevent for orphaned DataObjects. Maybe there is a better solution.
I didn't implement yet any test classes. This has still to be done.
It would be happy if you would include my code into your project!
Thanks Johannes