Re: List modification

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Jan 11 2006 - 08:35:58 EST

  • Next message: Dov Rosenberg: "Re: Cayenne and WebServices"

    Actually remote tier objects already allow direct list modification.
    So "a.getBList().add(b)" works just like "a.addToBList(b)", so I'd
    keep the default lists modifiable.

    Andrus

    On Jan 10, 2006, at 10:19 PM, Cris Daniluk wrote:

    > I just got bit by a nasty (and rather stupid) bug today. I was pulling
    > a toMany relationship, iterating it, and transforming it into another
    > object. I decided to get clever and use a BeanUtils Transformer to
    > clean up the code a bit and ended up transforming the list that
    > actually belonged to Cayenne (in other words, replacing *DataObjects
    > with non-DataObjects).
    >
    > Obviously the easy answer is that I shouldn't be careless, but I'm led
    > to wonder if it wouldn't be handy for the super classes to include a
    > Collections.unmodifiableList() wrapper around the ToManyList?
    >
    > I toyed with it quickly and it seems to work fine. Is there ever a
    > benefit to having the reference to the DataObject's ToManyList?
    >
    > Cris
    >



    This archive was generated by hypermail 2.0.0 : Wed Jan 11 2006 - 08:36:03 EST