You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cayenne.apache.org by John Huss <jo...@gmail.com> on 2013/10/04 23:42:09 UTC

API for changing to-many relationships

I'm curious about the API for changing to-many relationships.

It looks like for CayenneDataObject subclasses List (and probably Map)
relationships only support changes made using the addToManyTarget,
removeToManyTarget, and setToManyTarget methods -- with the exception that
add and addAll seem to work, but not remove, removeAll, retainAll or clear.


But for Set relationships the regular java collection methods can be used.
 And for ROP objects (direct PersistentObject subclasses) the regular java
collection methods are also supported.

Is that a fair assessment?  If so, this inconsistency seems less than
ideal.  Thoughts?

John

Re: API for changing to-many relationships

Posted by Andrus Adamchik <an...@objectstyle.org>.
IIRC we made an attempt with ROP to make regular collection methods work. I wouldn't mind if we can fill the gaps with the server-side collections.

Andrus

On Oct 4, 2013, at 5:42 PM, John Huss <jo...@gmail.com> wrote:

> I'm curious about the API for changing to-many relationships.
> 
> It looks like for CayenneDataObject subclasses List (and probably Map)
> relationships only support changes made using the addToManyTarget,
> removeToManyTarget, and setToManyTarget methods -- with the exception that
> add and addAll seem to work, but not remove, removeAll, retainAll or clear.
> 
> 
> But for Set relationships the regular java collection methods can be used.
> And for ROP objects (direct PersistentObject subclasses) the regular java
> collection methods are also supported.
> 
> Is that a fair assessment?  If so, this inconsistency seems less than
> ideal.  Thoughts?
> 
> John