cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jotpe <>
Subject [GitHub] cayenne pull request: draft for a toManyTarget setter
Date Mon, 05 Jan 2015 19:26:52 GMT
GitHub user jotpe opened a pull request:

    draft for a toManyTarget setter

    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` and `removeFromManyTarget` this method takes a input
`Collection<? extends DataObject>` and an optional `boolean` delete parameter (default
is false) for deletion
    of DataObjects, which relationships were removed.
    The method documentation should be more comprehensible, what the method does and what
    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

You can merge this pull request into a Git repository by running:

    $ git pull master

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #61
commit d7251014c9d5cb9396a83cd6e2f16e64af27e4b5
Author: jotpe <>
Date:   2014-12-27T22:58:06Z

    Second draft for a toManyTarget setter, which is implemented in
    CayenneDataObject (Davids intention). In difference to addToManyTarget
    or removeFromManyTarget this method takes a input Collection<? extends
    DataObject> and a boolean delete parameter for a additionally deletion
    of DataObject, which relationships were removed.
    The method documentation should explain exactly what this method does.
    The superclass.vm has 2 new methods for accessing the setToManyTarget
    with the relationName and Collection. The method without deletion flag
    calls setToManyTarget with deletion=false. Second method takes deletion


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message