Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

draft for a toManyTarget setter #61

Closed
wants to merge 4 commits into from
Closed

draft for a toManyTarget setter #61

wants to merge 4 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 5, 2015

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 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

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.
@asfbot
Copy link

asfbot commented Jan 5, 2015

Cayenne pull requests #54 FAILURE
Looks like there's a problem with this pull request

@ghost
Copy link
Author

ghost commented Jan 10, 2015

Opened a Jira for it - CAY-1983

jotpe added 2 commits February 1, 2015 06:27
…method with return list of unrelated DataObjects. Removed setToManyTarget from standard template.
@asfbot
Copy link

asfbot commented Feb 1, 2015

Cayenne pull requests #62 SUCCESS
This pull request looks good

@asfbot
Copy link

asfbot commented Feb 1, 2015

Cayenne pull requests #63 SUCCESS
This pull request looks good

@ghost
Copy link
Author

ghost commented Dec 6, 2015

for cleaning the commits

@ghost ghost closed this Dec 6, 2015
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant