cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jotpe <...@git.apache.org>
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:

    https://github.com/apache/cayenne/pull/61

    draft for a toManyTarget setter

    Sadly I didn't get any feedback this time at [developer mailinglist](http://mail-archives.apache.org/mod_mbox/cayenne-dev/201412.mbox/%3C549F3BB6.4050708%40gmail.com%3E).
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](http://mail-archives.apache.org/mod_mbox/cayenne-user/201412.mbox/%3C548BDF97.1040104%40gmail.com%3E).
    
    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
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


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

    $ git pull https://github.com/jotpe/cayenne master

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

    https://github.com/apache/cayenne/pull/61.patch

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 <jotpe.osm@gmail.com>
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
    flag.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message