Re: [jira] Created: (CAY-1000) Duplicate items in list.

From: Robert Zeigler (robert..uregumption.com)
Date: Wed Mar 05 2008 - 12:12:52 EST

  • Next message: Mike Kienenberger: "Re: [jira] Created: (CAY-1000) Duplicate items in list."

    As Kevin pointed out, calling:
            painting.setArtist
    twice results in
    artist.getPaintingArray().size() == 1

    However...

    painting.setArtist(artist);
    artist.addToPaintingArray(painting);

    Results in:

    artist.getPaintingArray().size() == 2

    Whether that's "inconsistent behavior" is up for discussion, but I
    know I've inadvertently set both sides of the relationship before.
    Anybody else? ;)

    Robert

    On Mar 5, 2008, at 3/510:07 AM , Mike Kienenberger wrote:

    > What happens if you call
    >
    > painting.setArtist(artist);
    > painting.setArtist(artist);
    >
    > If that doesn't give the same results as
    >
    > artist.addToPaintingArray(painting);
    > artist.addToPaintingArray(painting);
    >
    > then I would say it's a bug just due to the inconsistency.
    >
    >
    > Since we're not working with only abstract list concepts here, but are
    > using lists to model relationships, my opinion would be that having
    > the same object show up in the relationship list twice just because
    > you identified the relationship twice is a bug.
    >
    > For what use case would having the object show up twice be desired
    > behavior?
    >
    >
    > On Wed, Mar 5, 2008 at 10:43 AM, Andrus Adamchik <andru..bjectstyle.org
    > > wrote:
    >>
    >> On Mar 5, 2008, at 5:39 PM, Kevin Menard (JIRA) wrote:
    >>
    >>> However, it is fairly trivial to show that a relationship mapped as
    >>> a List can hold a duplicate.
    >>
    >> But the question then "is this a bug"? I don't think it is.
    >>
    >> Andrus
    >>
    >>



    This archive was generated by hypermail 2.0.0 : Wed Mar 05 2008 - 12:13:45 EST