RE: Same object from multiple datarow

From: Pirola Davide (davide.pirol..tin.it)
Date: Wed Jan 26 2005 - 03:45:21 EST

  • Next message: moraru_et..pymac.com: "strange result of deletequery"

    Hi,
    as usual yours suggests are precious :-)
    Now my List is correctly fill.
    Thank's
    Davide

    -----Original Message-----
    From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    Sent: mercoledì 26 gennaio 2005 1.24
    To: cayenne-use..bjectstyle.org
    Subject: Re: Same object from multiple datarow

    I guess the problem is in how you define a PK of the entity in
    question... You need to pick one or more columns (but at least one) on
    the DbEntity that uniquely identify each row. This is how Cayenne
    distinguishes between unique objects vs. duplicates.

    Andrus

    On Jan 25, 2005, at 11:38 AM, Pirola Davide wrote:
    > Hi,
    > i have a recordset with 4 records.
    > So, after executing a stored procedure, i have a List of 4 Cayenne
    > DataRow.
    > I want to map this list to my java object.
    > I have used dataContext.objectsFromDataRows, but the List returned is
    > a list of 4 objects with identical value (the first in the list)....
    > and not the 4 object contained in a List of DataRow.
    > If i implements a "for" cycle, and call dataContext.objectFromDataRow
    > for every DataRow contained in the list, the result is the same!!
    >
    > where is my fault?
    >
    > Thank's.
    > Davide
    >



    This archive was generated by hypermail 2.0.0 : Wed Jan 26 2005 - 03:45:02 EST