Re: AW: objectFromDataRow with refresh

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Sun Dec 17 2006 - 06:27:54 EST

  • Next message: Andrus Adamchik: "Re: modeling queries and inconsistent newlines"

    Hi Peter,

    Your solution is the way to go if you are merging data into existing
    rows. If you are doing a copy of the tmp table to the target table,
    always creating new rows, you may do a straight DataRow copy from one
    table to another bypassing object creation.
    org.apache.cayenne.access.DataPort does something similar - you can
    borrow some code from "processInsert" method.

    Andrus

    On Dec 14, 2006, at 1:56 PM, Peter Schröder wrote:
    > hi,
    >
    > first of all, thank you for the fast and helpfull komments in this
    > mailing-list.
    >
    > i have another question concerning context.objectFromDataRow():
    >
    > as you said, it populates the new data through the datacontext if
    > you use refresh=true. is there a possibility to advise cayenne to
    > store the "fresh" data into the database? i need this, because i
    > get the datarow from a tmp-table with the same structure as the
    > master table.
    > my workaround is, that i "clean" the object and put all data in it
    > back from the datarow and commit afterwards... i think there must
    > be a smarter solution to this.
    >
    > kind regards
    > peter
    >
    > -----Ursprüngliche Nachricht-----
    > Von: Andrus Adamchik [mailto:andru..bjectstyle.org]
    > Gesendet: Montag, 11. Dezember 2006 18:12
    > An: cayenne-use..ncubator.apache.org
    > Betreff: Re: objectFromDataRow with refresh
    >
    > Hi,
    >
    > It refreshes any previously cached version of the object with the
    > data stored in the passed data row.
    >
    > Andrus
    >
    > On Dec 11, 2006, at 5:31 PM, Peter Schröder wrote:
    >
    >> hi,
    >>
    >> i am wondering what the refresh param of context.objectFromDataRow
    >> does exactly?
    >>
    >> does it refresh the data of the object in the context, which i can
    >> commit with context.commitChanges,
    >> or does it fetch refreshed data for the object from the database?
    >>
    >> kind regards
    >> peter
    >>
    >
    >



    This archive was generated by hypermail 2.0.0 : Sun Dec 17 2006 - 06:30:08 EST